1 /*
2 Copyright Barrett Adair 2016-2017
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE.md or copy at http ://boost.org/LICENSE_1_0.txt)
5 */
6
7 #include <type_traits>
8 #include <functional>
9 #include <tuple>
10 #include <utility>
11 #include <boost/callable_traits.hpp>
12
13 using namespace boost::callable_traits;
14
15 #ifndef CT_ASSERT
16 #define CT_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__)
17 #endif //CT_ASSERT
18
19 #ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
20 #define LREF
21 #define RREF
22 #else
23 #define LREF &
24 #define RREF &&
25 #endif
26
27 #define TX_SAFE BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
28 #define VA_CC BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
29
30 #ifndef PP_CAT
31 #define PP_CAT_(x, y) x ## y
32 #define PP_CAT(x, y) PP_CAT_(x, y)
33 #endif
34
35 #ifdef USE_LAZY_TYPES
36 #define TRAIT(trait, ...) typename trait<__VA_ARGS__>::type
37 #else
38 #define TRAIT(trait, ...) PP_CAT(trait, _t)<__VA_ARGS__>
39 #endif
40
41 #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
42 #define TEST_NOEXCEPT_QUAL noexcept
43 #else
44 #define TEST_NOEXCEPT_QUAL
45 #endif
46
47 #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
48 #define TEST_ABOM_V
49 #else
50 #define TEST_ABOM_V volatile
51 #endif
52
53 template<typename T1, typename T2>
assert_same()54 void assert_same() {
55 CT_ASSERT(std::is_same<T1, T2>::value);
56 }
57