Skip to content

Commit a4f5ecb

Browse files
committed
is_[un]bounded_array
1 parent 69a1537 commit a4f5ecb

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

include/nbl/builtin/hlsl/type_traits.hlsl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
5454
template<class T> struct is_signed; (DONE)
5555
template<class T> struct is_unsigned; (DONE)
56-
template<class T> struct is_bounded_array;
56+
template<class T> struct is_bounded_array(DONE);
5757
template<class T> struct is_unbounded_array(DONE);
5858
template<class T> struct is_scoped_enum; (NOT-APPLICABLE)
5959
@@ -186,18 +186,22 @@ struct is_same<A,A> : bool_constant<true> {};
186186
template<class T>
187187
struct is_void : bool_constant<is_same<T, void>::value> {};
188188

189+
189190
template<class T>
190-
struct is_array : bool_constant<false> {};
191+
struct is_bounded_array : bool_constant<false> {};
191192

192193
template<class T, uint32_t count>
193-
struct is_array<T[count]> : bool_constant<true>{};
194+
struct is_bounded_array<T[count]> : bool_constant<true>{};
194195

195196
template<class T>
196197
struct is_unbounded_array : bool_constant<false>{};
197198

198199
template<class T>
199200
struct is_unbounded_array<T[]> : bool_constant<true>{};
200201

202+
template<class T>
203+
struct is_array : bool_constant<is_bounded_array<T>::value || is_unbounded_array<T>::value> {};
204+
201205
namespace impl
202206
{
203207

@@ -339,6 +343,12 @@ using is_void = std::is_void<T>;
339343
template<class T>
340344
using is_array = std::is_array<T>;
341345

346+
template<class T>
347+
using is_bounded_array = std::is_bounded_array<T>;
348+
349+
template<class T>
350+
using is_unbounded_array = std::is_unbounded_array<T>;
351+
342352
template<class T>
343353
using is_scalar = std::is_scalar<T>;
344354

0 commit comments

Comments
 (0)