HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 "SYS_API.h"
15 
16 #include <type_traits>
17 
18 /// @file
19 /// Provides facilities to decorate types that can then be tested using type
20 /// traits.
21 
22 /// Declare a type as arithmetic
23 #define SYS_DECLARE_IS_ARITHMETIC(T) \
24  namespace std { \
25  template<> struct is_arithmetic<T> : public true_type {}; \
26  } \
27  /* This remains for HDK compatibility */ \
28  namespace hboost { \
29  template <typename S> struct is_arithmetic; \
30  template<> struct is_arithmetic<T> : public std::true_type {}; \
31  } \
32  /**/
33 
34 /// Declare a type as POD
35 #define SYS_DECLARE_IS_POD(T) \
36  namespace std { \
37  template<> struct is_pod<T> : public true_type {}; \
38  } \
39  /* This remains for HDK compatibility */ \
40  namespace hboost { \
41  template <typename S> struct is_pod; \
42  template<> struct is_pod<T> : public std::true_type {}; \
43  } \
44  /**/
45 
46 #endif // __SYS_TYPEDECORATE_H_INCLUDED__