HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SYS_TypeDecorate.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: SYS_TypeDecorate.h (SYS Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __SYS_TYPEDECORATE_H_INCLUDED__
12 #define __SYS_TYPEDECORATE_H_INCLUDED__
13 
14 #include <type_traits>
15 
16 /// @file
17 /// Provides facilities to decorate types that can then be tested using type
18 /// traits.
19 
20 /// Declare a type as arithmetic
21 #define SYS_DECLARE_IS_ARITHMETIC(T) \
22  namespace std { \
23  template<> struct is_arithmetic<T> : public true_type {}; \
24  } \
25  /* This remains for HDK compatibility */ \
26  namespace hboost { \
27  template <typename S> struct is_arithmetic; \
28  template<> struct is_arithmetic<T> : public std::true_type {}; \
29  } \
30  /**/
31 
32 /// Declare a type as POD
33 #define SYS_DECLARE_IS_POD(T) \
34  namespace std { \
35  template<> struct is_pod<T> : public true_type {}; \
36  } \
37  /* This remains for HDK compatibility */ \
38  namespace hboost { \
39  template <typename S> struct is_pod; \
40  template<> struct is_pod<T> : public std::true_type {}; \
41  } \
42  /**/
43 
44 #endif // __SYS_TYPEDECORATE_H_INCLUDED__