File indexing completed on 2025-12-16 09:52:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_HANA_DETAIL_OPERATORS_MONAD_HPP
0011 #define BOOST_HANA_DETAIL_OPERATORS_MONAD_HPP
0012
0013 #include <boost/hana/config.hpp>
0014 #include <boost/hana/core/tag_of.hpp>
0015 #include <boost/hana/fwd/chain.hpp>
0016
0017 #include <type_traits>
0018
0019
0020 namespace boost { namespace hana { namespace detail {
0021 template <typename Tag>
0022 struct monad_operators {
0023 static constexpr bool value = false;
0024 };
0025
0026 namespace operators {
0027 template <typename Xs, typename F, typename = typename std::enable_if<
0028 detail::monad_operators<typename hana::tag_of<Xs>::type>::value
0029 >::type>
0030 constexpr auto operator|(Xs&& xs, F&& f)
0031 { return hana::chain(static_cast<Xs&&>(xs), static_cast<F&&>(f)); }
0032 }
0033 } }}
0034
0035 #endif