]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/callable_traits/detail/forward_declarations.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / callable_traits / detail / forward_declarations.hpp
CommitLineData
b32b8144
FG
1#ifndef BOOST_CLBL_TRTS_DETAIL_FORWARD_DECLARATIONS
2#define BOOST_CLBL_TRTS_DETAIL_FORWARD_DECLARATIONS
3#include <boost/callable_traits/detail/config.hpp>
4#include <boost/callable_traits/detail/default_callable_traits.hpp>
5
6namespace boost { namespace callable_traits { namespace detail {
7
8template<typename T>
9struct function;
10
11template<typename T>
12struct has_normal_call_operator
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
28struct callable_dummy {
29 void operator()() {}
30};
31
32template<typename T>
33using default_to_function_object = typename std::conditional<
34 has_normal_call_operator<T>::value,
35 T, callable_dummy>::type;
36
37template<typename T>
38struct pmf;
39
40template<typename T>
41struct pmd;
42
43template<typename F, typename T = typename std::remove_reference<F>::type>
44using function_object_base = typename std::conditional<
45 has_normal_call_operator<T>::value,
46 pmf<decltype(&default_to_function_object<T>::operator())>,
47 default_callable_traits<T>>::type;
48
49template<typename T, typename Base = function_object_base<T>>
50struct function_object;
51
52}}} // namespace boost::callable_traits::detail
53
54#endif // #ifndef BOOST_CLBL_TRTS_DETAIL_FORWARD_DECLARATIONS