]>
Commit | Line | Data |
---|---|---|
20effc67 TL |
1 | /* |
2 | Copyright 2020 Glen Joseph Fernandes | |
3 | (glenjofe@gmail.com) | |
4 | ||
5 | Distributed under the Boost Software License, | |
6 | Version 1.0. (See accompanying file LICENSE_1_0.txt | |
7 | or copy at http://www.boost.org/LICENSE_1_0.txt) | |
8 | */ | |
9 | #ifdef TEST_STD | |
10 | #include <type_traits> | |
11 | #else | |
12 | #include <boost/type_traits/is_scoped_enum.hpp> | |
13 | #endif | |
14 | #include "check_integral_constant.hpp" | |
15 | ||
16 | enum Unscoped { | |
17 | Constant = 1 | |
18 | }; | |
19 | ||
20 | #if !defined(BOOST_NO_CXX11_SCOPED_ENUMS) | |
21 | enum class Scoped { | |
22 | Constant = 2 | |
23 | }; | |
24 | #endif | |
25 | ||
26 | TT_TEST_BEGIN(is_scoped_enum) | |
27 | ||
28 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scoped_enum<void>::value, false); | |
29 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scoped_enum<int>::value, false); | |
30 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scoped_enum<Unscoped>::value, false); | |
31 | ||
32 | #if !defined(BOOST_NO_CXX11_SCOPED_ENUMS) | |
33 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scoped_enum<Scoped>::value, true); | |
34 | #endif | |
35 | ||
36 | TT_TEST_END |