]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | |
2 | // (C) Copyright John Maddock 2000. | |
3 | // Use, modification and distribution are subject to the | |
4 | // Boost Software License, Version 1.0. (See accompanying file | |
5 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | ||
7c673cae FG |
7 | #ifdef TEST_STD |
8 | # include <type_traits> | |
9 | #else | |
10 | # include <boost/type_traits/is_enum.hpp> | |
11 | #endif | |
11fdf7f2 TL |
12 | #include "test.hpp" |
13 | #include "check_integral_constant.hpp" | |
7c673cae FG |
14 | |
15 | #ifndef BOOST_NO_CXX11_SCOPED_ENUMS | |
16 | ||
17 | enum class test_enum | |
18 | { | |
19 | a, b | |
20 | }; | |
21 | ||
22 | #endif | |
23 | ||
24 | TT_TEST_BEGIN(is_enum) | |
25 | ||
26 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<int>::value, false); | |
27 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<enum_UDT>::value, true); | |
28 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<int_convertible>::value, false); | |
29 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<int&>::value, false); | |
30 | #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES | |
31 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<int&&>::value, false); | |
32 | #endif | |
33 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<boost::noncopyable>::value, false); | |
34 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<void>::value, false); | |
35 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<test_abc1>::value, false); | |
36 | #ifndef BOOST_NO_CXX11_SCOPED_ENUMS | |
37 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<test_enum>::value, true); | |
38 | #endif | |
39 | ||
40 | TT_TEST_END | |
41 | ||
42 | ||
43 | ||
44 | ||
45 | ||
46 | ||
47 | ||
48 |