1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef BOOST_HANA_FUNCTIONAL_ON_HPP
- #define BOOST_HANA_FUNCTIONAL_ON_HPP
- #include <boost/hana/config.hpp>
- #include <boost/hana/detail/create.hpp>
- #include <boost/hana/functional/infix.hpp>
- #include <utility>
- namespace boost { namespace hana {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #ifdef BOOST_HANA_DOXYGEN_INVOKED
- constexpr auto on = infix([](auto&& f, auto&& g) {
- return [perfect-capture](auto&& ...x) -> decltype(auto) {
- return forwarded(f)(g(forwarded(x))...);
- };
- });
- #else
- template <typename F, typename G>
- struct on_t {
- F f; G g;
- template <typename ...X>
- constexpr decltype(auto) operator()(X&& ...x) const& {
- return f(g(static_cast<X&&>(x))...);
- }
- template <typename ...X>
- constexpr decltype(auto) operator()(X&& ...x) & {
- return f(g(static_cast<X&&>(x))...);
- }
- template <typename ...X>
- constexpr decltype(auto) operator()(X&& ...x) && {
- return std::move(f)(g(static_cast<X&&>(x))...);
- }
- };
- BOOST_HANA_INLINE_VARIABLE constexpr auto on = infix(detail::create<on_t>{});
- #endif
- }}
- #endif
|