]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | #include <tuple> |
2 | #include <utility> | |
3 | #include <type_traits> | |
4 | #include <boost/callable_traits/qualified_class_of.hpp> | |
5 | #include "test.hpp" | |
6 | ||
7 | struct foo; | |
8 | ||
9 | int main() { | |
10 | ||
11 | { | |
12 | using f = void(foo::*)(); | |
13 | using test = TRAIT(qualified_class_of, f); | |
14 | using expect = foo &; | |
15 | CT_ASSERT(std::is_same<test, expect>::value); | |
16 | } | |
17 | ||
18 | { | |
19 | using f = void(foo::*)() const; | |
20 | using test = TRAIT(qualified_class_of, f); | |
21 | using expect = foo const &; | |
22 | CT_ASSERT(std::is_same<test, expect>::value); | |
23 | } | |
24 | ||
25 | { | |
26 | using f = void(foo::*)() volatile; | |
27 | using test = TRAIT(qualified_class_of, f); | |
28 | using expect = foo volatile &; | |
29 | CT_ASSERT(std::is_same<test, expect>::value); | |
30 | } | |
31 | ||
32 | { | |
33 | using f = void(BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC foo::*)(int, ...) const volatile; | |
34 | using test = TRAIT(qualified_class_of, f); | |
35 | using expect = foo const volatile &; | |
36 | CT_ASSERT(std::is_same<test, expect>::value); | |
37 | } | |
38 | ||
39 | { | |
40 | using f = int foo::*; | |
41 | using test = TRAIT(qualified_class_of, f); | |
42 | using expect = foo const &; | |
43 | CT_ASSERT(std::is_same<test, expect>::value); | |
44 | } | |
45 | ||
46 | { | |
47 | using f = const int foo::*; | |
48 | using test = TRAIT(qualified_class_of, f); | |
49 | using expect = foo const &; | |
50 | CT_ASSERT(std::is_same<test, expect>::value); | |
51 | } | |
52 | } |