diff options
Diffstat (limited to 'src/boost/libs/callable_traits/test/class_of.cpp')
-rw-r--r-- | src/boost/libs/callable_traits/test/class_of.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/boost/libs/callable_traits/test/class_of.cpp b/src/boost/libs/callable_traits/test/class_of.cpp new file mode 100644 index 00000000..2048a33f --- /dev/null +++ b/src/boost/libs/callable_traits/test/class_of.cpp @@ -0,0 +1,52 @@ +#include <tuple> +#include <utility> +#include <type_traits> +#include <boost/callable_traits/class_of.hpp> +#include "test.hpp" + +struct foo; + +int main() { + + { + using f = void(foo::*)(); + using test = TRAIT(class_of, f); + using expect = foo; + CT_ASSERT(std::is_same<test, expect>::value); + } + + { + using f = void(foo::*)() const; + using test = TRAIT(class_of, f); + using expect = foo; + CT_ASSERT(std::is_same<test, expect>::value); + } + + { + using f = void(foo::*)() volatile; + using test = TRAIT(class_of, f); + using expect = foo; + CT_ASSERT(std::is_same<test, expect>::value); + } + + { + using f = void(BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC foo::*)(int, ...) const volatile; + using test = TRAIT(class_of, f); + using expect = foo; + CT_ASSERT(std::is_same<test, expect>::value); + } + + { + using f = int foo::*; + using test = TRAIT(class_of, f); + using expect = foo; + CT_ASSERT(std::is_same<test, expect>::value); + } + + { + using f = const int foo::*; + using test = TRAIT(class_of, f); + using expect = foo; + CT_ASSERT(std::is_same<test, expect>::value); + } +} |