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 "SYS_TypeTraits.h"
15 
16 #include <type_traits>
17 
18 
19 /// @file
20 /// Provides facilities to decorate types that can then be tested using type
21 /// traits.
22 
23 /// Declare a type as integral
24 #define SYS_DECLARE_IS_INTEGRAL(T) \
25  namespace SYS_TypeTraitsImpl{ template<> struct AddIntegralNoCV< T > : public std::true_type { \
26  static_assert( ! ( std::is_const< T >::value || std::is_volatile< T >::value ), \
27  "SYS_DECLARE_IS_INTEGRAL must be used on types without const/volatile qualifiers" ); \
28  }; }\
29  /**/
30 
31 /// Declare a type as floating point
32 #define SYS_DECLARE_IS_FLOATING_POINT(T) \
33  namespace SYS_TypeTraitsImpl{ template<> struct AddFloatingPointNoCV< T > : public std::true_type { \
34  static_assert( ! ( std::is_const< T >::value || std::is_volatile< T >::value ), \
35  "SYS_DECLARE_IS_FLOATING_POINT must be used on types without const/volatile qualifiers" ); \
36  }; }\
37  /**/
38 
39 /// Declare a type as POD
40 #define SYS_DECLARE_IS_POD(T) \
41  namespace SYS_TypeTraitsImpl{ template<> struct AddPodNoCV< T > : public std::true_type { \
42  static_assert( ! ( std::is_const< T >::value || std::is_volatile< T >::value ), \
43  "SYS_DECLARE_IS_POD must be used on types without const/volatile qualifiers" ); \
44  }; }\
45  /**/
46 
47 #endif // __SYS_TYPEDECORATE_H_INCLUDED__