29 #ifndef VC_TRAITS_IS_OUTPUT_ITERATOR_H_
30 #define VC_TRAITS_IS_OUTPUT_ITERATOR_H_
34 namespace Vc_VERSIONED_NAMESPACE
38 namespace is_output_iterator_impl
40 template <typename T, typename ValueType = typename std::iterator_traits<T>::value_type,
41 typename = decltype(*std::declval<T &>() = std::declval<
46 std::true_type test(
int);
47 template <
typename T> std::false_type test(...);
51 struct is_output_iterator
52 :
public std::conditional<
53 std::is_void<typename std::iterator_traits<T>::value_type>::value,
54 std::true_type, decltype(is_output_iterator_impl::test<T>(int()))>::type
58 static_assert(!std::is_void<std::iterator_traits<int *>::value_type>::value,
"");
59 static_assert(is_output_iterator<int *>::value,
"");
60 static_assert(!is_output_iterator<const int *>::value,
"");
65 #endif // VC_TRAITS_IS_OUTPUT_ITERATOR_H_