Skip to content

Commit 65e649f

Browse files
committed
has_member_x_with_type
1 parent 72972a9 commit 65e649f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/nbl/builtin/hlsl/member_test_macros.hlsl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@ struct is_static_member_##a: false_type {NBL_CONSTEXPR_STATIC_INLINE bool is_con
5959
template<class T> \
6060
struct is_static_member_##a<T,typename enable_if<!is_same<decltype(T::a),void>::value,void>::type>: is_const_helper<decltype(T::a), true> {}; \
6161
template<class T, class=void> \
62-
struct is_member_##a: false_type {NBL_CONSTEXPR_STATIC_INLINE bool is_constant = false;}; \
62+
struct is_member_##a: false_type {NBL_CONSTEXPR_STATIC_INLINE bool is_constant = false; using type = void; }; \
6363
template<class T> \
6464
struct is_member_##a<T,typename enable_if<!is_same<decltype(declval<T>().a),void>::value,void>::type> : is_const_helper<decltype(declval<T>().a), true>{}; \
6565
} \
6666
template<class T> \
6767
struct has_member_##a { NBL_CONSTEXPR_STATIC_INLINE e_member_presence value = (e_member_presence)(impl::is_member_##a<T>::value + impl::is_static_member_##a<T>::value + impl::is_static_member_##a<T>::is_constant); }; \
68+
template<class T, class F> struct has_member_##a##_with_type : bool_constant<has_member_##a<T>::value && is_same<typename impl::is_member_##a<T>::type, F>::value> {}; \
6869
} \
6970
}
7071

0 commit comments

Comments
 (0)