// Copyright 2020 Peter Dimov // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include #include #include enum E1 {}; #if !defined(BOOST_NO_CXX11_SCOPED_ENUMS) enum E2: long {}; enum class E3 {}; enum class E4: long {}; #endif struct X { operator int() const { return 0; } }; struct Y; template void test_true() { using boost::endian::detail::is_fixed_enum; BOOST_TEST_TRAIT_TRUE((is_fixed_enum)); BOOST_TEST_TRAIT_TRUE((is_fixed_enum)); BOOST_TEST_TRAIT_TRUE((is_fixed_enum)); BOOST_TEST_TRAIT_TRUE((is_fixed_enum)); } template void test_false() { using boost::endian::detail::is_fixed_enum; BOOST_TEST_TRAIT_FALSE((is_fixed_enum)); BOOST_TEST_TRAIT_FALSE((is_fixed_enum)); BOOST_TEST_TRAIT_FALSE((is_fixed_enum)); BOOST_TEST_TRAIT_FALSE((is_fixed_enum)); } int main() { test_false(); test_false(); test_false(); test_false(); test_false(); test_false(); test_false(); test_false(); #if !defined(BOOST_NO_CXX11_SCOPED_ENUMS) #if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) test_true(); #endif test_true(); test_true(); #endif return boost::report_errors(); }