tricky_is_enum_test.cpp 665 B

123456789101112131415161718192021222324252627
  1. // (C) Copyright Dave Abrahams 2003. Use, modification and distribution is
  2. // subject to the Boost Software License, Version 1.0. (See accompanying
  3. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #ifdef TEST_STD
  5. # include <type_traits>
  6. #else
  7. # include <boost/type_traits/is_enum.hpp>
  8. #endif
  9. #include "test.hpp"
  10. #include "check_integral_constant.hpp"
  11. struct convertible_to_anything
  12. {
  13. template<typename T> operator T() { return 0; }
  14. };
  15. TT_TEST_BEGIN(is_enum)
  16. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<convertible_to_anything>::value, false);
  17. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<int[] >::value, false);
  18. TT_TEST_END