23 message(
"bsoncxx/util/functor.hpp header is deprecated and will be removed in an upcoming "
37template <
typename FunctionLike,
typename Signature>
38using is_functor = std::is_convertible<FunctionLike, std::function<Signature>>;
44template <
typename,
typename>
45struct build_free_function;
47template <
typename F,
typename R,
typename... Args>
48struct build_free_function<F, R(Args...)> {
49 typedef R (*type)(Args...);
52template <
typename,
typename>
53struct build_class_function;
55template <
typename C,
typename R,
typename... Args>
56struct build_class_function<C, R(Args...)> {
57 typedef R (C::*type)(Args...);
61struct strip_cv_from_class_function;
63template <
typename C,
typename R,
typename... Args>
64struct strip_cv_from_class_function<R (C::*)(Args...)> {
65 typedef R (C::*type)(Args...);
68template <
typename C,
typename R,
typename... Args>
69struct strip_cv_from_class_function<R (C::*)(Args...) const> {
70 typedef R (C::*type)(Args...);
73template <
typename C,
typename R,
typename... Args>
74struct strip_cv_from_class_function<R (C::*)(Args...) volatile> {
75 typedef R (C::*type)(Args...);
78template <
typename C,
typename S>
79struct is_class_method_with_signature {
85 static typename std::enable_if<std::is_convertible<typename build_class_function<C, S>::type,
86 typename strip_cv_from_class_function<
87 decltype(&T::operator())>::type>::value,
92 static no sfinae(...);
94 static bool constexpr value =
sizeof(sfinae<C>(
nullptr)) ==
sizeof(yes);
97template <
typename F,
typename S>
98struct is_function_with_signature
99 : std::is_convertible<F, typename build_free_function<F, S>::type> {};
101template <
typename C,
typename S,
bool>
102struct is_functor_impl : is_class_method_with_signature<C, S> {};
104template <
typename F,
typename S>
105struct is_functor_impl<F, S, false> : is_function_with_signature<F, S> {};
109template <
typename C,
typename S>
110struct is_functor : functor::is_functor_impl<C, S, std::is_class<C>::value> {};
The bsoncxx macro guard postlude header.
The bsoncxx macro guard prelude header.
BSONCXX_DEPRECATED typedef types::bson_value::view value
Equivalent to bsoncxx::v_noabi::types::bson_value::view.
Definition value.hpp:30
The top-level namespace within which all bsoncxx library entities are declared.