Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / ACE / tests / Compiler_Features_16_Test.cpp
blobb806b572929e344c74ecec73c44c514dacba3564
1 /**
2 * This program checks if the compiler / platform supports strongly
3 * typed enums
4 */
6 #include "test_config.h"
8 #if defined (ACE_HAS_CPP11)
10 #include <limits>
11 #include <stdint.h>
12 #include <ostream>
14 static constexpr uint32_t bound = std::numeric_limits<uint32_t>::max();
16 namespace CORBA {
17 // First forward declare TCKind, this is legal with C++11
18 enum class TCKind : uint32_t;
20 enum class TCKind : uint32_t
22 tk_null,
23 tk_void,
24 tk_event
25 };// TCKind
27 // And another forward declared TCKind, after it has been
28 // declared
29 enum class TCKind : uint32_t;
32 std::ostream& operator<<
33 (std::ostream& strm,CORBA::TCKind _enumerator)
35 switch (_enumerator) {
36 case CORBA::TCKind::tk_null: return strm << "CORBA::TCKind::tk_null"; break;
37 case CORBA::TCKind::tk_void: return strm << "CORBA::TCKind::tk_void"; break;
38 default: return strm;
42 int
43 run_main (int, ACE_TCHAR *[])
45 ACE_START_TEST (ACE_TEXT("Compiler_Features_16_Test"));
47 ACE_DEBUG ((LM_INFO,
48 ACE_TEXT ("Strongly typed enums work.\n")));
50 ACE_END_TEST;
52 return 0;
55 #else
56 int
57 run_main (int, ACE_TCHAR *[])
59 ACE_START_TEST (ACE_TEXT("Compiler_Features_16_Test"));
61 ACE_DEBUG ((LM_INFO,
62 ACE_TEXT ("No C++11 support enabled\n")));
64 ACE_END_TEST;
65 return 0;
68 #endif