1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #ifndef BOOST_HOF_GUARD_DECAY_H
- #define BOOST_HOF_GUARD_DECAY_H
- #include <boost/hof/detail/delegate.hpp>
- #include <boost/hof/detail/unwrap.hpp>
- #include <boost/hof/detail/static_const_var.hpp>
- #include <boost/hof/detail/forward.hpp>
- namespace boost { namespace hof { namespace detail {
- template<class T>
- struct decay_mf
- : unwrap_reference<typename std::decay<T>::type>
- {};
- struct decay_f
- {
- template<
- class T,
- class Result=typename unwrap_reference<typename std::decay<T>::type>::type,
- class=typename std::enable_if<(BOOST_HOF_IS_CONSTRUCTIBLE(Result, T))>::type
- >
- constexpr Result operator()(T&& x) const BOOST_HOF_NOEXCEPT_CONSTRUCTIBLE(Result, T&&)
- {
- return BOOST_HOF_FORWARD(T)(x);
- }
- };
- }
- BOOST_HOF_DECLARE_STATIC_VAR(decay, detail::decay_f);
- }}
- #endif
|