]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/hana/fwd/concat.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / hana / fwd / concat.hpp
CommitLineData
7c673cae
FG
1/*!
2@file
3Forward declares `boost::hana::concat`.
4
b32b8144 5@copyright Louis Dionne 2013-2017
7c673cae
FG
6Distributed under the Boost Software License, Version 1.0.
7(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
8 */
9
10#ifndef BOOST_HANA_FWD_CONCAT_HPP
11#define BOOST_HANA_FWD_CONCAT_HPP
12
13#include <boost/hana/config.hpp>
14#include <boost/hana/core/when.hpp>
15
16
1e59de90 17namespace boost { namespace hana {
7c673cae
FG
18 //! Combine two monadic structures together.
19 //! @ingroup group-MonadPlus
20 //!
21 //! Given two monadic structures, `concat` combines them together and
22 //! returns a new monadic structure. The exact definition of `concat`
23 //! will depend on the exact model of MonadPlus at hand, but for
24 //! sequences it corresponds intuitively to simple concatenation.
25 //!
26 //! Also note that combination is not required to be commutative.
27 //! In other words, there is no requirement that
28 //! @code
29 //! concat(xs, ys) == concat(ys, xs)
30 //! @endcode
31 //! and indeed it does not hold in general.
32 //!
33 //!
34 //! Signature
35 //! ---------
36 //! Given a `MonadPlus` `M`, the signature of `concat` is
37 //! @f$ \mathtt{concat} : M(T) \times M(T) \to M(T) @f$.
38 //!
39 //! @param xs, ys
40 //! Two monadic structures to combine together.
41 //!
42 //!
43 //! Example
44 //! -------
45 //! @include example/concat.cpp
46#ifdef BOOST_HANA_DOXYGEN_INVOKED
47 constexpr auto concat = [](auto&& xs, auto&& ys) {
48 return tag-dispatched;
49 };
50#else
51 template <typename M, typename = void>
52 struct concat_impl : concat_impl<M, when<true>> { };
53
54 struct concat_t {
55 template <typename Xs, typename Ys>
56 constexpr auto operator()(Xs&& xs, Ys&& ys) const;
57 };
58
1e59de90 59 BOOST_HANA_INLINE_VARIABLE constexpr concat_t concat{};
7c673cae 60#endif
1e59de90 61}} // end namespace boost::hana
7c673cae
FG
62
63#endif // !BOOST_HANA_FWD_CONCAT_HPP