| 1 | #ifndef BOOST_DESCRIBE_ENUMERATORS_HPP_INCLUDED |
| 2 | #define BOOST_DESCRIBE_ENUMERATORS_HPP_INCLUDED |
| 3 | |
| 4 | // Copyright 2020, 2021 Peter Dimov |
| 5 | // Distributed under the Boost Software License, Version 1.0. |
| 6 | // https://www.boost.org/LICENSE_1_0.txt |
| 7 | |
| 8 | #include <boost/describe/detail/void_t.hpp> |
| 9 | #include <boost/describe/detail/config.hpp> |
| 10 | |
| 11 | #if defined(BOOST_DESCRIBE_CXX11) |
| 12 | |
| 13 | #include <type_traits> |
| 14 | |
| 15 | namespace boost |
| 16 | { |
| 17 | namespace describe |
| 18 | { |
| 19 | |
| 20 | // describe_enumerators<E> |
| 21 | |
| 22 | template<class E> using describe_enumerators = decltype( boost_enum_descriptor_fn( static_cast<E**>(0) ) ); |
| 23 | |
| 24 | // has_describe_enumerators<E> |
| 25 | |
| 26 | namespace detail |
| 27 | { |
| 28 | |
| 29 | template<class E, class En = void> struct has_describe_enumerators: std::false_type |
| 30 | { |
| 31 | }; |
| 32 | |
| 33 | template<class E> struct has_describe_enumerators<E, void_t<describe_enumerators<E>>>: std::true_type |
| 34 | { |
| 35 | }; |
| 36 | |
| 37 | } // namespace detail |
| 38 | |
| 39 | template<class E> using has_describe_enumerators = detail::has_describe_enumerators<E>; |
| 40 | |
| 41 | } // namespace describe |
| 42 | } // namespace boost |
| 43 | |
| 44 | #endif // defined(BOOST_DESCRIBE_CXX11) |
| 45 | |
| 46 | #endif // #ifndef BOOST_DESCRIBE_ENUMERATORS_HPP_INCLUDED |
| 47 | |