boost_no_scoped_enums.ipp 924 B

12345678910111213141516171819202122232425262728
  1. // (C) Copyright Beman Dawes 2008
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for more information.
  6. // MACRO: BOOST_NO_CXX11_SCOPED_ENUMS
  7. // TITLE: C++0x scoped enum unavailable
  8. // DESCRIPTION: The compiler does not support C++0x scoped enum
  9. namespace boost_no_cxx11_scoped_enums {
  10. int test()
  11. {
  12. enum class scoped_enum { yes, no, maybe };
  13. // This tests bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
  14. bool b = (scoped_enum::yes == scoped_enum::yes)
  15. && (scoped_enum::yes != scoped_enum::no)
  16. && (scoped_enum::yes < scoped_enum::no)
  17. && (scoped_enum::yes <= scoped_enum::no)
  18. && (scoped_enum::no > scoped_enum::yes)
  19. && (scoped_enum::no >= scoped_enum::yes);
  20. return b ? 0 : 1;
  21. }
  22. }