File indexing completed on 2025-01-30 09:43:36
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_HANA_FUSE_HPP
0011 #define BOOST_HANA_FUSE_HPP
0012
0013 #include <boost/hana/fwd/fuse.hpp>
0014
0015 #include <boost/hana/config.hpp>
0016 #include <boost/hana/detail/decay.hpp>
0017 #include <boost/hana/unpack.hpp>
0018
0019
0020 namespace boost { namespace hana {
0021 namespace detail {
0022 template <typename F>
0023 struct fused {
0024 F f;
0025 template <typename Xs>
0026 constexpr decltype(auto) operator()(Xs&& xs) const&
0027 { return hana::unpack(static_cast<Xs&&>(xs), f); }
0028
0029 template <typename Xs>
0030 constexpr decltype(auto) operator()(Xs&& xs) &
0031 { return hana::unpack(static_cast<Xs&&>(xs), f); }
0032
0033 template <typename Xs>
0034 constexpr decltype(auto) operator()(Xs&& xs) &&
0035 { return hana::unpack(static_cast<Xs&&>(xs), static_cast<F&&>(f)); }
0036 };
0037 }
0038
0039
0040 template <typename F>
0041 constexpr auto fuse_t::operator()(F&& f) const {
0042 return detail::fused<typename detail::decay<F>::type>{static_cast<F&&>(f)};
0043 }
0044
0045 }}
0046
0047 #endif