• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*<-
2 Copyright (c) 2016 Barrett Adair
3 
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
6 ->*/
7 
8 //[ is_invocable
9 #include <type_traits>
10 #include <boost/callable_traits/is_invocable.hpp>
11 
12 namespace ct = boost::callable_traits;
13 
14 struct foo {
15     template<typename T>
16     typename std::enable_if<std::is_integral<T>::value>::type
operator ()foo17     operator()(T){}
18 };
19 
20 static_assert(ct::is_invocable<foo, int>::value, "");
21 static_assert(!ct::is_invocable<foo, double>::value, "");
22 
main()23 int main() {}
24 //]
25