File indexing completed on 2025-01-18 09:38:15
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_HOF_GUARD_DECAY_H
0009 #define BOOST_HOF_GUARD_DECAY_H
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #include <boost/hof/detail/delegate.hpp>
0038 #include <boost/hof/detail/unwrap.hpp>
0039 #include <boost/hof/detail/static_const_var.hpp>
0040 #include <boost/hof/detail/forward.hpp>
0041
0042 namespace boost { namespace hof { namespace detail {
0043
0044 template<class T>
0045 struct decay_mf
0046 : unwrap_reference<typename std::decay<T>::type>
0047 {};
0048
0049 struct decay_f
0050 {
0051 template<
0052 class T,
0053 class Result=typename unwrap_reference<typename std::decay<T>::type>::type,
0054 class=typename std::enable_if<(BOOST_HOF_IS_CONSTRUCTIBLE(Result, T))>::type
0055 >
0056 constexpr Result operator()(T&& x) const BOOST_HOF_NOEXCEPT_CONSTRUCTIBLE(Result, T&&)
0057 {
0058 return BOOST_HOF_FORWARD(T)(x);
0059 }
0060 };
0061
0062 }
0063
0064 BOOST_HOF_DECLARE_STATIC_VAR(decay, detail::decay_f);
0065
0066 }}
0067
0068 #endif