28 #ifndef VC_TRAITS_IS_OUTPUT_ITERATOR_H_
29 #define VC_TRAITS_IS_OUTPUT_ITERATOR_H_
33 namespace Vc_VERSIONED_NAMESPACE
37 namespace is_output_iterator_impl
39 template <typename T, typename ValueType = typename std::iterator_traits<T>::value_type,
40 typename = decltype(*std::declval<T &>() = std::declval<
45 std::true_type test(
int);
46 template <
typename T> std::false_type test(...);
50 struct is_output_iterator
51 :
public std::conditional<
52 std::is_void<typename std::iterator_traits<T>::value_type>::value,
53 std::true_type, decltype(is_output_iterator_impl::test<T>(int()))>::type
57 static_assert(!std::is_void<std::iterator_traits<int *>::value_type>::value,
"");
58 static_assert(is_output_iterator<int *>::value,
"");
59 static_assert(!is_output_iterator<const int *>::value,
"");
64 #endif // VC_TRAITS_IS_OUTPUT_ITERATOR_H_