File indexing completed on 2025-01-18 09:28:19
0001
0002
0003
0004 #ifndef BOOST_DETAIL_FUNCTION1_DWA200655_HPP
0005 # define BOOST_DETAIL_FUNCTION1_DWA200655_HPP
0006
0007 # include <boost/concept_check.hpp>
0008 # include <boost/type_traits/remove_reference.hpp>
0009 # include <boost/type_traits/add_const.hpp>
0010 # include <boost/mpl/apply.hpp>
0011
0012 namespace boost { namespace detail {
0013
0014
0015
0016
0017
0018
0019
0020 template<typename F>
0021 struct function1
0022 {
0023 template<typename Signature>
0024 struct result
0025 {};
0026
0027 template<typename This, typename A0>
0028 struct result<This(A0)>
0029 {
0030
0031
0032
0033
0034
0035
0036
0037
0038 typedef typename remove_reference<
0039 typename add_const< A0 >::type
0040 >::type arg0;
0041
0042 typedef typename mpl::apply1<F, arg0>::type impl;
0043 typedef typename impl::result_type type;
0044 };
0045
0046
0047 template<typename A0>
0048 typename result<function1(A0 &)>::type
0049 operator ()(A0 &a0) const
0050 {
0051 typedef typename result<function1(A0 &)>::impl impl;
0052 typedef typename result<function1(A0 &)>::type type;
0053 typedef A0 &arg0;
0054 BOOST_CONCEPT_ASSERT((UnaryFunction<impl, type, arg0>));
0055
0056 return impl()(a0);
0057 }
0058
0059
0060 template<typename A0>
0061 typename result<function1(A0 const &)>::type
0062 operator ()(A0 const &a0) const
0063 {
0064 typedef typename result<function1(A0 const &)>::impl impl;
0065 typedef typename result<function1(A0 const &)>::type type;
0066 typedef A0 const &arg0;
0067 BOOST_CONCEPT_ASSERT((UnaryFunction<impl, type, arg0>));
0068
0069 return impl()(a0);
0070 }
0071 };
0072
0073 }}
0074
0075 #endif