28 #ifndef VC_TRAITS_HAS_SUBSCRIPT_OPERATOR_H_
29 #define VC_TRAITS_HAS_SUBSCRIPT_OPERATOR_H_
34 template <
typename T,
typename I,
typename = decltype(std::declval<T &>()[std::declval<I>()])> std::true_type test(
int);
35 template <
typename T,
typename I> std::false_type test(
float);
39 template <
typename T,
typename I = std::
size_t>
40 struct has_subscript_operator :
public decltype(has_subscript_operator_impl::test<T, I>(1))
44 static_assert(has_subscript_operator<
int[]>::value,
"");
45 static_assert(has_subscript_operator<
int[],
int>::value,
"");
46 static_assert(!has_subscript_operator<
int[],
void *>::value,
"");
48 #endif // VC_TRAITS_HAS_SUBSCRIPT_OPERATOR_H_