Compile fixes
[ACE_TAO.git] / ACE / tests / Compiler_Features_37_Test.cpp
blob8fe14fda578ef22bd1ec3fdd84ae1d1bbcc1c146
1 /**
2 * This program checks if the compiler doesn't have a certain bug
3 * that we encountered when testing with ACE
4 */
6 #include "test_config.h"
7 #include <utility>
9 template <typename key, typename value>
10 class my_map
12 public:
13 my_map () : capacity_ (0), nodes_(0) {}
14 ~my_map ();
15 using key_type = key;
16 using data_type = value;
17 using value_type = std::pair<key, value>;
18 size_t capacity_;
19 value_type* nodes_;
22 template <typename key, typename value>
23 my_map<key, value>::~my_map ()
25 for (size_t i = 0; i != capacity_; ++i)
27 #if defined (ACE_HAS_BCC32)
28 using std::pair;
29 (nodes_ + i)->~pair<key, value>();
30 #else
31 (nodes_ + i)->~value_type ();
32 #endif
36 class Bar
38 public:
39 Bar () {}
40 ~Bar () {}
43 int
44 run_main (int, ACE_TCHAR *[])
46 ACE_START_TEST (ACE_TEXT("Compiler_Features_37_Test"));
48 my_map <size_t, Bar*> foo;
49 ACE_UNUSED_ARG(foo);
51 ACE_DEBUG ((LM_INFO,
52 ACE_TEXT ("C++ support ok\n")));
54 ACE_END_TEST;
56 return 0;