From 7866749a2a05e8edc694c9bb77f9c3d375147ae0 Mon Sep 17 00:00:00 2001 From: Frank Park Date: Tue, 11 Apr 2017 01:09:31 -0400 Subject: [PATCH] move is_invocable to type_traits.h --- include/sqlpp11/type_traits.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/sqlpp11/type_traits.h b/include/sqlpp11/type_traits.h index cf377f07..5e5056f6 100644 --- a/include/sqlpp11/type_traits.h +++ b/include/sqlpp11/type_traits.h @@ -533,6 +533,16 @@ namespace sqlpp template using serializer_context_of = typename serializer_context_of_impl::type; + + template + struct in_invocable + { + template static auto test(U* p) -> decltype((*p)(std::declval()...), void(), std::true_type()); + template static auto test(...) -> decltype(std::false_type()); + + typedef decltype(test(0)) type; + static constexpr bool value = decltype(test(0))::value; + }; } #endif