IsValid.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_UTIL_TYPETRAITS_ISVALID_H_
36 #define _BLAZE_UTIL_TYPETRAITS_ISVALID_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/util/FalseType.h>
44 #include <blaze/util/InvalidType.h>
45 #include <blaze/util/TrueType.h>
46 
47 
48 namespace blaze {
49 
50 //=================================================================================================
51 //
52 // CLASS DEFINITION
53 //
54 //=================================================================================================
55 
56 //*************************************************************************************************
75 template< typename T >
76 struct IsValid : public TrueType
77 {
78  public:
79  //**********************************************************************************************
81  enum { value = 1 };
82  typedef TrueType Type;
84  //**********************************************************************************************
85 };
86 //*************************************************************************************************
87 
88 
89 //*************************************************************************************************
91 template<>
93 struct IsValid<INVALID_TYPE> : public FalseType
94 {
95  public:
96  //**********************************************************************************************
97  enum { value = 0 };
98  typedef FalseType Type;
99  //**********************************************************************************************
100 };
102 //*************************************************************************************************
103 
104 
105 //*************************************************************************************************
107 template<>
109 struct IsValid<const INVALID_TYPE> : public FalseType
110 {
111  public:
112  //**********************************************************************************************
113  enum { value = 0 };
114  typedef FalseType Type;
115  //**********************************************************************************************
116 };
118 //*************************************************************************************************
119 
120 
121 //*************************************************************************************************
123 template<>
125 struct IsValid<volatile INVALID_TYPE> : public FalseType
126 {
127  public:
128  //**********************************************************************************************
129  enum { value = 0 };
130  typedef FalseType Type;
131  //**********************************************************************************************
132 };
134 //*************************************************************************************************
135 
136 
137 //*************************************************************************************************
139 template<>
141 struct IsValid<const volatile INVALID_TYPE> : public FalseType
142 {
143  public:
144  //**********************************************************************************************
145  enum { value = 0 };
146  typedef FalseType Type;
147  //**********************************************************************************************
148 };
150 //*************************************************************************************************
151 
152 } // namespace blaze
153 
154 #endif
Header file for the FalseType type/value trait base class.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Utility type for generic codes.
boost::false_type FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
boost::true_type TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Compile time type check.This class tests whether the given template parameter is a valid or invalid d...
Definition: IsValid.h:76
Header file for the TrueType type/value trait base class.