@@ -86,10 +86,11 @@ struct has_xy {
86
86
typedef char No[2 ];
87
87
88
88
// Valid only if .x, .y exist and are the right type: return a Yes.
89
- template <typename C,
90
- IMATH_ENABLE_IF (std::is_same<decltype (C().x), Base>::value),
91
- IMATH_ENABLE_IF (std::is_same<decltype (C().y), Base>::value)>
92
- static Yes& test (int );
89
+ template <
90
+ typename C,
91
+ IMATH_ENABLE_IF (std::is_same<decltype (C {}.x), Base>::value),
92
+ IMATH_ENABLE_IF (std::is_same<decltype (C {}.y), Base>::value)>
93
+ static Yes& test (int );
93
94
94
95
// Fallback, default to returning a No.
95
96
template <typename C> static No& test (...);
@@ -110,11 +111,12 @@ struct has_xyz {
110
111
typedef char No[2 ];
111
112
112
113
// Valid only if .x, .y, .z exist and are the right type: return a Yes.
113
- template <typename C,
114
- IMATH_ENABLE_IF (std::is_same<decltype (C().x), Base>::value),
115
- IMATH_ENABLE_IF (std::is_same<decltype (C().y), Base>::value),
116
- IMATH_ENABLE_IF (std::is_same<decltype (C().z), Base>::value)>
117
- static Yes& test (int );
114
+ template <
115
+ typename C,
116
+ IMATH_ENABLE_IF (std::is_same<decltype (C {}.x), Base>::value),
117
+ IMATH_ENABLE_IF (std::is_same<decltype (C {}.y), Base>::value),
118
+ IMATH_ENABLE_IF (std::is_same<decltype (C {}.z), Base>::value)>
119
+ static Yes& test (int );
118
120
119
121
// Fallback, default to returning a No.
120
122
template <typename C> static No& test (...);
@@ -135,12 +137,13 @@ struct has_xyzw {
135
137
typedef char No[2 ];
136
138
137
139
// Valid only if .x, .y, .z, .w exist and are the right type: return a Yes.
138
- template <typename C,
139
- IMATH_ENABLE_IF (std::is_same<decltype (C().x), Base>::value),
140
- IMATH_ENABLE_IF (std::is_same<decltype (C().y), Base>::value),
141
- IMATH_ENABLE_IF (std::is_same<decltype (C().z), Base>::value),
142
- IMATH_ENABLE_IF (std::is_same<decltype (C().w), Base>::value)>
143
- static Yes& test (int );
140
+ template <
141
+ typename C,
142
+ IMATH_ENABLE_IF (std::is_same<decltype (C {}.x), Base>::value),
143
+ IMATH_ENABLE_IF (std::is_same<decltype (C {}.y), Base>::value),
144
+ IMATH_ENABLE_IF (std::is_same<decltype (C {}.z), Base>::value),
145
+ IMATH_ENABLE_IF (std::is_same<decltype (C {}.w), Base>::value)>
146
+ static Yes& test (int );
144
147
145
148
// Fallback, default to returning a No.
146
149
template <typename C> static No& test (...);
@@ -162,9 +165,12 @@ struct has_subscript {
162
165
typedef char No[2 ];
163
166
164
167
// Valid only if T[] is possible and is the right type: return a Yes.
165
- template <typename C,
166
- IMATH_ENABLE_IF (std::is_same<typename std::decay<decltype (C()[0 ])>::type, Base>::value)>
167
- static Yes& test (int );
168
+ template <
169
+ typename C,
170
+ IMATH_ENABLE_IF (std::is_same<
171
+ typename std::decay<decltype (C {}[0 ])>::type,
172
+ Base>::value)>
173
+ static Yes& test (int );
168
174
169
175
// Fallback, default to returning a No.
170
176
template <typename C> static No& test (...);
@@ -191,9 +197,12 @@ struct has_double_subscript {
191
197
typedef char No[2 ];
192
198
193
199
// Valid only if T[][] is possible and is the right type: return a Yes.
194
- template <typename C,
195
- IMATH_ENABLE_IF (std::is_same<typename std::decay<decltype (C()[0 ][0 ])>::type, Base>::value)>
196
- static Yes& test (int );
200
+ template <
201
+ typename C,
202
+ IMATH_ENABLE_IF (std::is_same<
203
+ typename std::decay<decltype (C {}[0 ][0 ])>::type,
204
+ Base>::value)>
205
+ static Yes& test (int );
197
206
198
207
// Fallback, default to returning a No.
199
208
template <typename C> static No& test (...);
0 commit comments