| 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 | |
| 14 | namespace boost { |
| 15 | namespace beast { |
| 16 | namespace detail { |
| 17 | |
| 18 | namespace { |
| 19 | |
| 20 | // |
| 21 | // is_invocable |
| 22 | // |
| 23 | |
| 24 | struct is_invocable_udt1 |
| 25 | { |
| 26 | void operator()(int) const; |
| 27 | }; |
| 28 | |
| 29 | struct is_invocable_udt2 |
| 30 | { |
| 31 | int operator()(int) const; |
| 32 | }; |
| 33 | |
| 34 | struct is_invocable_udt3 |
| 35 | { |
| 36 | int operator()(int); |
| 37 | }; |
| 38 | |
| 39 | struct is_invocable_udt4 |
| 40 | { |
| 41 | void operator()(std::unique_ptr<int>); |
| 42 | }; |
| 43 | |
| 44 | #ifndef __INTELLISENSE__ |
| 45 | // VFALCO Fails to compile with Intellisense |
| 46 | BOOST_STATIC_ASSERT(is_invocable<is_invocable_udt1, void(int)>::value); |
| 47 | BOOST_STATIC_ASSERT(is_invocable<is_invocable_udt2, int(int)>::value); |
| 48 | BOOST_STATIC_ASSERT(is_invocable<is_invocable_udt3, int(int)>::value); |
| 49 | BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt1, void(void)>::value); |
| 50 | BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt2, int(void)>::value); |
| 51 | BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt2, void(void)>::value); |
| 52 | BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt3 const, int(int)>::value); |
| 53 | BOOST_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 |
