| 1 | // Copyright 2021 Peter Dimov |
| 2 | // Distributed under the Boost Software License, Version 1.0. |
| 3 | // https://www.boost.org/LICENSE_1_0.txt |
| 4 | |
| 5 | #include <boost/describe/enumerators.hpp> |
| 6 | #include <boost/describe/enum.hpp> |
| 7 | #include <boost/core/lightweight_test.hpp> |
| 8 | |
| 9 | #if defined(_MSC_VER) |
| 10 | # pragma warning(disable: 4003) // not enough arguments for macro invocation |
| 11 | #endif |
| 12 | |
| 13 | enum E1 { a1, b1, c1, }; |
| 14 | BOOST_DESCRIBE_ENUM(E1, a1, b1, c1, ) |
| 15 | |
| 16 | BOOST_DEFINE_ENUM(E2, a2, b2, c2, ) |
| 17 | |
| 18 | #if !defined(BOOST_DESCRIBE_CXX14) |
| 19 | |
| 20 | #include <boost/config/pragma_message.hpp> |
| 21 | |
| 22 | BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available" ) |
| 23 | int main() {} |
| 24 | |
| 25 | #else |
| 26 | |
| 27 | #include <boost/mp11.hpp> |
| 28 | using namespace boost::mp11; |
| 29 | |
| 30 | int main() |
| 31 | { |
| 32 | { |
| 33 | using D1 = boost::describe::describe_enumerators<E1>; |
| 34 | BOOST_TEST_EQ( mp_size<D1>::value, 3 ); |
| 35 | } |
| 36 | |
| 37 | { |
| 38 | using D2 = boost::describe::describe_enumerators<E2>; |
| 39 | BOOST_TEST_EQ( mp_size<D2>::value, 3 ); |
| 40 | } |
| 41 | |
| 42 | return boost::report_errors(); |
| 43 | } |
| 44 | |
| 45 | #endif // !defined(BOOST_DESCRIBE_CXX14) |
| 46 | |