All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IsEven.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_UTIL_VALUETRAITS_ISEVEN_H_
23 #define _BLAZE_UTIL_VALUETRAITS_ISEVEN_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
30 #include <blaze/util/FalseType.h>
31 #include <blaze/util/SelectType.h>
32 #include <blaze/util/TrueType.h>
33 
34 
35 namespace blaze {
36 
37 //=================================================================================================
38 //
39 // CLASS DEFINITION
40 //
41 //=================================================================================================
42 
43 //*************************************************************************************************
61 template< size_t N >
62 struct IsEven : public SelectType<N%2,FalseType,TrueType>::Type
63 {
64  public:
65  //**********************************************************************************************
67  enum { value = ( N%2 )?( 0 ):( 1 ) };
68  typedef typename SelectType<N%2,FalseType,TrueType>::Type Type;
70  //**********************************************************************************************
71 };
72 //*************************************************************************************************
73 
74 } // namespace blaze
75 
76 #endif