forward_declarations.hpp
Go to the documentation of this file.
1 #ifndef BOOST_CLBL_TRTS_DETAIL_FORWARD_DECLARATIONS
2 #define BOOST_CLBL_TRTS_DETAIL_FORWARD_DECLARATIONS
5 
6 namespace boost { namespace callable_traits { namespace detail {
7 
8 template<typename T>
9 struct function;
10 
11 template<typename T>
13 {
14  template<typename N, N Value>
15  struct check { check(std::nullptr_t) {} };
16 
17  template<typename U>
18  static std::int8_t test(
19  check<decltype(&U::operator()), &U::operator()>);
20 
21  template<typename>
22  static std::int16_t test(...);
23 
24  static constexpr bool value =
25  sizeof(test<T>(nullptr)) == sizeof(std::int8_t);
26 };
27 
29  void operator()() {}
30 };
31 
32 template<typename T>
33 using default_to_function_object = typename std::conditional<
35  T, callable_dummy>::type;
36 
37 template<typename T>
38 struct pmf;
39 
40 template<typename T>
41 struct pmd;
42 
43 template<typename F, typename T = typename std::remove_reference<F>::type>
44 using function_object_base = typename std::conditional<
48 
49 template<typename T, typename Base = function_object_base<T>>
50 struct function_object;
51 
52 }}} // namespace boost::callable_traits::detail
53 
54 #endif // #ifndef BOOST_CLBL_TRTS_DETAIL_FORWARD_DECLARATIONS
typename std::conditional< has_normal_call_operator< T >::value, T, callable_dummy >::type default_to_function_object
typename std::conditional< has_normal_call_operator< T >::value, pmf< decltype(&default_to_function_object< T >::operator())>, default_callable_traits< T > >::type function_object_base
static std::int8_t test(check< decltype(&U::operator()), &U::operator()>)