All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Subscriptable.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_UTIL_CONSTRAINTS_SUBSCRIPTABLE_H_
23 #define _BLAZE_UTIL_CONSTRAINTS_SUBSCRIPTABLE_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
31 #include <blaze/util/Suffix.h>
32 
33 
34 namespace blaze {
35 
36 //=================================================================================================
37 //
38 // MUST_BE_SUBSCRIBTABLE CONSTRAINT
39 //
40 //=================================================================================================
41 
42 //*************************************************************************************************
51 template< typename T >
52 struct CONSTRAINT_MUST_BE_SUBSCRIBTABLE_FAILED
53 {
54  private:
55  //**********************************************************************************************
56  static T createT();
57  //**********************************************************************************************
58 
59  public:
60  //**********************************************************************************************
61  enum { T_is_not_subscriptable = sizeof( createT()[0] ),
62  value = 1 };
63  //**********************************************************************************************
64 };
66 //*************************************************************************************************
67 
68 
69 //*************************************************************************************************
75 #define BLAZE_CONSTRAINT_MUST_BE_SUBSCRIPTABLE(T) \
76  typedef \
77  ::blaze::CONSTRAINT_TEST< \
78  ::blaze::CONSTRAINT_MUST_BE_SUBSCRIBTABLE_FAILED< T >::value > \
79  BLAZE_JOIN( CONSTRAINT_MUST_BE_SUBSCRIPTABLE_TYPEDEF, __LINE__ )
80 //*************************************************************************************************
81 
82 
83 
84 
85 //=================================================================================================
86 //
87 // MUST_BE_SUBSCRIBTABLE_AS_DECAYABLE_POINTER CONSTRAINT
88 //
89 //=================================================================================================
90 
91 //*************************************************************************************************
100 template< typename T >
101 struct CONSTRAINT_MUST_BE_SUBSCRIBTABLE_AS_DECAYABLE_POINTER_FAILED
102 {
103  private:
104  //**********************************************************************************************
105  static T createT();
106  //**********************************************************************************************
107 
108  public:
109  //**********************************************************************************************
110  enum { T_is_not_subscriptable = sizeof( 0[createT()] ),
111  value = 1 };
112  //**********************************************************************************************
113 };
115 //*************************************************************************************************
116 
117 
118 //*************************************************************************************************
124 #define BLAZE_CONSTRAINT_MUST_BE_SUBSCRIPTABLE_AS_DECAYABLE_POINTER(T) \
125  typedef \
126  ::blaze::CONSTRAINT_TEST< \
127  ::blaze::CONSTRAINT_MUST_BE_SUBSCRIBTABLE_AS_DECAYABLE_POINTER_FAILED< T >::value > \
128  BLAZE_JOIN( CONSTRAINT_MUST_BE_SUBSCRIBTABLE_AS_DECAYABLE_POINTER_TYPEDEF, __LINE__ )
129 //*************************************************************************************************
130 
131 } // namespace blaze
132 
133 #endif