]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/test/is_enum_test.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / type_traits / test / is_enum_test.cpp
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
7 #include "test.hpp"
8 #include "check_integral_constant.hpp"
9 #ifdef TEST_STD
10 # include <type_traits>
11 #else
12 # include <boost/type_traits/is_enum.hpp>
13 #endif
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