28 #ifndef VC_TRAITS_HAS_CONTIGUOUS_STORAGE_H_
29 #define VC_TRAITS_HAS_CONTIGUOUS_STORAGE_H_
31 #include <initializer_list>
34 #ifdef _LIBCPP_BEGIN_NAMESPACE_STD
35 _LIBCPP_BEGIN_NAMESPACE_STD
41 template <
typename T,
size_t N>
class array;
43 template <
typename T,
size_t N>
struct array;
45 template <
typename T,
typename Allocator>
class vector;
46 #ifdef _LIBCPP_END_NAMESPACE_STD
47 _LIBCPP_END_NAMESPACE_STD
52 namespace Vc_VERSIONED_NAMESPACE
56 namespace has_contiguous_storage_detail
60 template <
typename T,
typename It =
typename T::iterator>
61 std::is_base_of<std::random_access_iterator_tag,
62 typename std::iterator_traits<It>::iterator_category>
67 std::is_base_of<std::random_access_iterator_tag,
68 typename std::iterator_traits<T>::iterator_category>
72 template <
typename T> std::false_type test(...);
76 struct has_contiguous_storage_impl
77 :
public decltype(has_contiguous_storage_detail::test<T>(int())) {
81 struct has_contiguous_storage
82 :
public has_contiguous_storage_impl<
83 typename std::remove_cv<typename std::remove_reference<T>::type>::type>
88 template <
typename T>
struct has_contiguous_storage_impl<const T *> :
public std::true_type {};
89 template <
typename T>
struct has_contiguous_storage_impl<T *> :
public std::true_type {};
90 template <
typename T>
struct has_contiguous_storage_impl<std::unique_ptr<T[]>> :
public std::true_type {};
91 template <
typename T>
struct has_contiguous_storage_impl<std::initializer_list<T>> :
public std::true_type {};
92 template <
typename T, std::
size_t N>
struct has_contiguous_storage_impl<T[N]> :
public std::true_type {};
93 template <
typename T, std::
size_t N>
struct has_contiguous_storage_impl<std::array<T, N>> :
public std::true_type {};
94 template <
typename T,
typename A>
struct has_contiguous_storage_impl<std::
vector<T, A>> :
public std::true_type {};
99 #endif // VC_TRAITS_HAS_CONTIGUOUS_STORAGE_H_