1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef BOOST_HOF_GUARD_FUNCTION_TAP_H
- #define BOOST_HOF_GUARD_FUNCTION_TAP_H
- #include <boost/hof/pipable.hpp>
- #include <boost/hof/apply.hpp>
- #include <boost/hof/detail/static_const_var.hpp>
- namespace boost { namespace hof { namespace detail {
- struct tap_f
- {
- template<class T, class F>
- constexpr T operator()(T&& x, const F& f) const
- BOOST_HOF_RETURNS_DEDUCE_NOEXCEPT((boost::hof::apply(f, x), BOOST_HOF_FORWARD(T)(x)))
- {
- return boost::hof::apply(f, x), BOOST_HOF_FORWARD(T)(x);
- }
- };
- }
- BOOST_HOF_DECLARE_STATIC_VAR(tap, pipable_adaptor<detail::tap_f>);
- }}
- #endif
|