1//
2// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
3//
4// Distributed under the Boost Software License, Version 1.0. (See accompanying
5// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6//
7// Official repository: https://github.com/boostorg/beast
8//
9
10#include <boost/beast/core/detail/config.hpp>
11#include <boost/beast/core/detail/is_invocable.hpp>
12#include <memory>
13
14namespace boost {
15namespace beast {
16namespace detail {
17
18namespace {
19
20//
21// is_invocable
22//
23
24struct is_invocable_udt1
25{
26 void operator()(int) const;
27};
28
29struct is_invocable_udt2
30{
31 int operator()(int) const;
32};
33
34struct is_invocable_udt3
35{
36 int operator()(int);
37};
38
39struct is_invocable_udt4
40{
41 void operator()(std::unique_ptr<int>);
42};
43
44#ifndef __INTELLISENSE__
45// VFALCO Fails to compile with Intellisense
46BOOST_STATIC_ASSERT(is_invocable<is_invocable_udt1, void(int)>::value);
47BOOST_STATIC_ASSERT(is_invocable<is_invocable_udt2, int(int)>::value);
48BOOST_STATIC_ASSERT(is_invocable<is_invocable_udt3, int(int)>::value);
49BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt1, void(void)>::value);
50BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt2, int(void)>::value);
51BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt2, void(void)>::value);
52BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt3 const, int(int)>::value);
53BOOST_STATIC_ASSERT(is_invocable<is_invocable_udt4, void(std::unique_ptr<int>)>::value);
54#endif
55
56} // (anonymous)
57
58} // detail
59} // beast
60} // boost
61

source code of boost/libs/beast/test/beast/core/_detail_is_invocable.cpp