| 91 | } |
| 92 | |
| 93 | TEST(hasContiguousStorage) |
| 94 | { |
| 95 | std::unique_ptr<int[]> a(new int[3]); |
| 96 | int b[3] = {1, 2, 3}; |
| 97 | const std::unique_ptr<int[]> c(new int[3]); |
| 98 | const int d[3] = {1, 2, 3}; |
| 99 | auto &&e = {1, 2, 3}; |
| 100 | const auto &f = {1, 2, 3}; |
| 101 | std::vector<int> g; |
| 102 | std::array<int, 3> h; |
| 103 | hasContiguousStorageImpl(a.get(), "T[]"); |
| 104 | hasContiguousStorageImpl(a, "std::unique_ptr<T[]>"); |
| 105 | hasContiguousStorageImpl(&a[0], "T *"); |
| 106 | hasContiguousStorageImpl(b, "T[3]"); |
| 107 | hasContiguousStorageImpl(c.get(), "const T[]"); |
| 108 | hasContiguousStorageImpl(c, "std::unique_ptr<const T[]>"); |
| 109 | hasContiguousStorageImpl(&c[0], "const T *"); |
| 110 | hasContiguousStorageImpl(d, "const T[3]"); |
| 111 | hasContiguousStorageImpl(e, "std::initializer_list 1"); |
| 112 | hasContiguousStorageImpl(f, "std::initializer_list 2"); |
| 113 | hasContiguousStorageImpl(g, "std::vector<int>"); |
| 114 | hasContiguousStorageImpl(g.begin(), "std::vector<int>::iterator"); |
| 115 | hasContiguousStorageImpl(g.cbegin(), "std::vector<int>::iterator"); |
| 116 | hasContiguousStorageImpl(h, "std::array<int, 3>"); |
| 117 | hasContiguousStorageImpl(h.begin(), "std::array<int, 3>::iterator"); |
| 118 | hasContiguousStorageImpl(h.cbegin(), "std::array<int, 3>::iterator"); |
| 119 | VERIFY(!(Vc::Traits::has_contiguous_storage<std::list<int>>::value)); |
| 120 | VERIFY(!(Vc::Traits::has_contiguous_storage<std::list<int>::iterator>::value)); |
| 121 | VERIFY(!(Vc::Traits::has_contiguous_storage<std::list<int>::const_iterator>::value)); |
| 122 | VERIFY(!(Vc::Traits::has_contiguous_storage<std::map<int, int>>::value)); |
| 123 | VERIFY(!(Vc::Traits::has_contiguous_storage<std::map<int, int>::iterator>::value)); |
| 124 | VERIFY(!(Vc::Traits::has_contiguous_storage<std::unordered_map<int, int>>::value)); |
| 125 | VERIFY(!(Vc::Traits::has_contiguous_storage<std::unordered_map<int, int>::iterator>::value)); |
| 126 | } |
| 127 | |
| 128 | struct F0 { |
| 129 | template <typename T> void operator()(T &) const {} |
nothing calls this directly
no test coverage detected