/[svn]/libgig/trunk/src/Serialization.h
ViewVC logotype

Diff of /libgig/trunk/src/Serialization.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3156 by schoenebeck, Mon May 8 17:18:07 2017 UTC revision 3166 by schoenebeck, Tue May 9 16:10:36 2017 UTC
# Line 35  Line 35 
35  #include <vector>  #include <vector>
36  #include <map>  #include <map>
37  #include <time.h>  #include <time.h>
38    #if __cplusplus < 201103L
39    # include <tr1/type_traits>
40    #endif
41    
42  /** @brief Serialization / deserialization framework.  /** @brief Serialization / deserialization framework.
43   *   *
# Line 110  namespace Serialization { Line 113  namespace Serialization {
113    
114      template<typename T>      template<typename T>
115      bool IsEnum(const T& data) {      bool IsEnum(const T& data) {
116            #if __cplusplus < 201103L
117            return std::tr1::is_enum<T>::value;
118            #else
119          return __is_enum(T);          return __is_enum(T);
120            #endif
121      }      }
122    
123      template<typename T>      template<typename T>
124      bool IsUnion(const T& data) {      bool IsUnion(const T& data) {
125            #if __cplusplus < 201103L
126            return false; // without compiler support we cannot distinguish union from class
127            #else
128          return __is_union(T);          return __is_union(T);
129            #endif
130      }      }
131    
132      template<typename T>      template<typename T>
133      bool IsClass(const T& data) {      bool IsClass(const T& data) {
134            #if __cplusplus < 201103L
135            return std::tr1::__is_union_or_class<T>::value; // without compiler support we cannot distinguish union from class
136            #else
137          return __is_class(T);          return __is_class(T);
138            #endif
139      }      }
140    
141      /*template<typename T>      /*template<typename T>

Legend:
Removed from v.3156  
changed lines
  Added in v.3166

  ViewVC Help
Powered by ViewVC