MorphoGraphX  2.0-1-227
Common.hpp
Go to the documentation of this file.
1 #ifndef COMMON_HPP
2 #define COMMON_HPP
3 
4 #include <Config.hpp>
5 
6 // prior to C++11, initializing static members other than int was not standardized
7 // http://stackoverflow.com/questions/9141950/initializing-const-member-within-class-declaration-in-c#9208326
8 #if __cplusplus < 201103L
9 # define constexpr const
10 #endif
11 
12 // Use HASH_NS_ENTER/_EXIT to enter the appropriate namespace inside std:: (either none or tr1)
13 #define HASH_NS_ENTER
14 #define HASH_NS_EXIT
15 
16 #ifdef MGX_USE_TR1
17 # ifdef __GNUC__
18 # include <Features.hpp>
19 # if __GNUC_PREREQ(4, 0)
20 # include <tr1/unordered_map>
21 # include <tr1/unordered_set>
22 namespace std
23 {
24  using std::tr1::unordered_map;
25  using std::tr1::unordered_set;
26  using std::tr1::hash;
27 }
28 # undef HASH_NS_ENTER
29 # undef HASH_NS_EXIT
30 # define HASH_NS_ENTER namespace tr1 {
31 # define HASH_NS_EXIT }
32 # else
33 # error "GCC does not have hash types before the version 4.0"
34 # endif
35 # endif
36 #else // Use C++11 STL types
37 # include <unordered_map>
38 # include <unordered_set>
39 #endif
40 
41 #endif // COMMON_HPP
Features.hpp