5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_INLINE_CONTAINER_TESTING_EXTERNAL_VECTOR_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_INLINE_CONTAINER_TESTING_EXTERNAL_VECTOR_HPP_
10#include <initializer_list>
20#include <gmock/gmock.h>
21#include <gtest/gtest.h>
68ARENE_IGNORE_ALL(
"-Wfloat-equal",
"These tests don't perform arithmetic, so equality is OK even for floating point");
80 template <std::
size_t Capacity>
96 template <
typename Vector,
typename... Args>
104 operator T() const noexcept(false) { return ::arene::base::testing::test_value<T>(0); }
140 template <
typename U,
bool OperatorsNoexcept>
168 template <typename U>
172 template <typename U>
178 template <typename... U>
187 return ::arene::base::testing::test_value<T>(idx);
200 return ::arene::base::testing::test_external_vector<T>(storage, begin, end);
240 EXPECT_EQ(TestFixture::construct(TestFixture::standard_storage).
capacity(), TestFixture::capacity);
249 STATIC_ASSERT_TRUE(
noexcept(TestFixture::construct().
capacity()));
250 STATIC_ASSERT_TRUE(
noexcept(TestFixture::construct(TestFixture::standard_storage).
capacity()));
255 ASSERT_EQ(TestFixture::construct().
size(), 0);
256 ASSERT_EQ(TestFixture::construct(TestFixture::standard_storage).
size(), 0);
265 (
typename TestFixture::vector{
266 TestFixture::standard_storage,
267 {TestFixture::test_value(0), TestFixture::test_value(1)}
278 typename TestFixture::vector vec{TestFixture::standard_storage};
279 vec.push_back(TestFixture::test_value(0));
280 EXPECT_EQ(vec.size(), 1);
286 typename TestFixture::vector vec{TestFixture::standard_storage};
287 TypeParam
const value = TestFixture::test_value(0);
288 vec.push_back(value);
289 EXPECT_EQ(vec.back(), value);
295 typename TestFixture::vector vec{TestFixture::standard_storage};
296 TypeParam
const value = TestFixture::test_value(0);
297 vec.push_back(value);
298 ASSERT_FALSE(vec.empty());
304 typename TestFixture::vector vec{TestFixture::standard_storage};
305 TypeParam
const value1 = TestFixture::test_value(0);
306 vec.push_back(value1);
307 TypeParam
const value2 = TestFixture::test_value(1);
308 vec.push_back(value2);
309 EXPECT_EQ(vec.size(), 2);
310 EXPECT_EQ(vec.back(), value2);
334 ASSERT_TRUE(TestFixture::construct(TestFixture::standard_storage).
empty());
343#if ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED)
344 ASSERT_THROW(TestFixture::construct().at(0), std::out_of_range);
346 GTEST_SKIP() <<
"`at` tests are skipped when exceptions are disabled.";
353#if ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED)
354 auto vec = TestFixture::construct(TestFixture::standard_storage);
355 TypeParam
const value = TestFixture::test_value(0);
356 vec.push_back(value);
357 EXPECT_EQ(vec.at(0), value);
359 GTEST_SKIP() <<
"`at` tests are skipped when exceptions are disabled.";
366#if ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED)
367 ::testing::StaticAssertTypeEq<decltype(std::declval<typename TestFixture::vector&>().at(0)), TypeParam&>();
369 GTEST_SKIP() <<
"`at` tests are skipped when exceptions are disabled.";
376#if ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED)
377 ::testing::StaticAssertTypeEq<decltype(std::declval<typename TestFixture::vector const&>().at(0)), TypeParam
const&>(
380 GTEST_SKIP() <<
"`at` tests are skipped when exceptions are disabled.";
387#if ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED)
388 auto vec = TestFixture::construct(TestFixture::standard_storage);
389 TypeParam
const value1 = TestFixture::test_value(0);
390 vec.push_back(value1);
391 TypeParam
const value2 = TestFixture::test_value(1);
392 vec.push_back(value2);
394 EXPECT_EQ(vec.at(0), value1);
395 EXPECT_EQ(vec.at(1), value2);
397 GTEST_SKIP() <<
"`at` tests are skipped when exceptions are disabled.";
404#if ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED)
405 auto vec = TestFixture::construct(TestFixture::standard_storage);
406 TypeParam
const value1 = TestFixture::test_value(0);
407 vec.push_back(value1);
408 TypeParam
const value2 = TestFixture::test_value(1);
409 vec.push_back(value2);
411 ASSERT_THROW(vec.at(vec.size()), std::out_of_range);
412 ASSERT_THROW(vec.at(vec.size() * 2), std::out_of_range);
415 GTEST_SKIP() <<
"`at` tests are skipped when exceptions are disabled.";
422#if ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED)
423 auto vec = TestFixture::construct(TestFixture::standard_storage);
424 TypeParam
const value1 = TestFixture::test_value(0);
425 vec.push_back(value1);
426 TypeParam
const value2 = TestFixture::test_value(1);
427 vec.push_back(value2);
429 auto const& const_vec = vec;
430 EXPECT_EQ(const_vec.at(0), value1);
431 EXPECT_EQ(const_vec.at(1), value2);
433 GTEST_SKIP() <<
"`at` tests are skipped when exceptions are disabled.";
440#if ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED)
441 auto vec = TestFixture::construct(TestFixture::standard_storage);
442 TypeParam
const value1 = TestFixture::test_value(0);
443 vec.push_back(value1);
444 TypeParam
const value2 = TestFixture::test_value(1);
445 vec.push_back(value2);
447 auto const& const_vec = vec;
449 ASSERT_THROW(const_vec.at(vec.size()), std::out_of_range);
450 ASSERT_THROW(const_vec.at(vec.size() * 2), std::out_of_range);
453 GTEST_SKIP() <<
"`at` tests are skipped when exceptions are disabled.";
459 ASSERT_EQ(TestFixture::construct(TestFixture::standard_storage).
max_size(), TestFixture::capacity);
460 ASSERT_EQ(TestFixture::construct().
max_size(), 0);
461 ASSERT_TRUE(
noexcept(TestFixture::construct().
max_size()));
465 ASSERT_EQ(
typename TestFixture::vector{storage2}.max_size(), capacity2);
470 auto vec = TestFixture::construct(TestFixture::standard_storage);
472 vec.push_back(TestFixture::test_value(0));
474 ASSERT_DEATH(vec.push_back(TestFixture::test_value(0)),
"Precondition violation");
482 ASSERT_EQ(zvec.begin(), zvec.end());
483 ASSERT_EQ(czvec.begin(), czvec.end());
484 ASSERT_EQ(zvec.size(), 0);
485 ASSERT_EQ(czvec.size(), 0);
491 ASSERT_DEATH(vec.push_back(TestFixture::test_value(0)),
"Precondition violation");
498 auto vec = TestFixture::construct(TestFixture::standard_storage);
500 TypeParam
const value1 = TestFixture::test_value(0);
501 vec.push_back(value1);
502 TypeParam& val1 = vec.back();
504 TypeParam
const value2 = TestFixture::test_value(1);
505 vec.push_back(value2);
506 TypeParam& val2 = vec.back();
517 auto vec = TestFixture::construct(TestFixture::standard_storage);
518 auto const& const_vec = vec;
520 TypeParam
const value1 = TestFixture::test_value(0);
521 vec.push_back(value1);
522 auto& val1 = const_vec.back();
523 ::testing::StaticAssertTypeEq<decltype(val1), TypeParam const&>();
525 TypeParam
const value2 = TestFixture::test_value(1);
526 vec.push_back(value2);
527 auto& val2 = const_vec.back();
528 ::testing::StaticAssertTypeEq<decltype(val2), TypeParam const&>();
544 TestFixture::test_value(0),
545 TestFixture::test_value(1),
546 TestFixture::test_value(2),
547 TestFixture::test_value(3)
550 typename TestFixture::vector
const vec{TestFixture::standard_storage, values};
552 noexcept(
typename TestFixture::vector{TestFixture::standard_storage, values}),
556 EXPECT_THAT(vec, ::testing::ElementsAreArray(values));
562 auto vec = TestFixture::test_external_vector(TestFixture::standard_storage, 4);
564 ::testing::StaticAssertTypeEq<
decltype(vec.front()), TypeParam&>();
565 STATIC_ASSERT_TRUE(
noexcept(vec.front()));
566 auto const& const_vec = vec;
567 EXPECT_EQ(&const_vec.front(), &const_vec[0]);
568 ::testing::StaticAssertTypeEq<
decltype(const_vec.front()), TypeParam
const&>();
569 STATIC_ASSERT_TRUE(
noexcept(const_vec.front()));
575 auto vec = TestFixture::construct(TestFixture::standard_storage);
576 ::testing::StaticAssertTypeEq<
decltype(vec.begin()),
typename TestFixture::vector::iterator>();
577 ::testing::StaticAssertTypeEq<
decltype(vec.end()),
typename TestFixture::vector::iterator>();
578 STATIC_ASSERT_TRUE(
noexcept(vec.begin()));
579 STATIC_ASSERT_TRUE(
noexcept(vec.end()));
580 EXPECT_EQ(vec.begin(), vec.end());
589 TestFixture::test_value(0),
590 TestFixture::test_value(1),
591 TestFixture::test_value(2),
592 TestFixture::test_value(3)
594 typename TestFixture::vector vec{
595 TestFixture::standard_storage,
598 auto const result = std::mismatch(values.begin(), values.end(), vec.begin(), vec.end());
599 EXPECT_EQ(
result.first, values.end());
600 EXPECT_EQ(
result.second, vec.end());
609 TestFixture::test_value(0),
610 TestFixture::test_value(1),
611 TestFixture::test_value(2),
612 TestFixture::test_value(3)
614 typename TestFixture::vector
const vec{TestFixture::standard_storage, values};
615 auto const result = std::mismatch(values.begin(), values.end(), vec.begin(), vec.end());
616 EXPECT_EQ(
result.first, values.end());
617 EXPECT_EQ(
result.second, vec.end());
622 using vec =
typename TestFixture::vector;
623 ::testing::StaticAssertTypeEq<typename std::iterator_traits<typename vec::iterator>::value_type, TypeParam>();
624 ::testing::StaticAssertTypeEq<typename std::iterator_traits<typename vec::iterator>::reference, TypeParam&>();
625 ::testing::StaticAssertTypeEq<typename std::iterator_traits<typename vec::iterator>::pointer, TypeParam*>();
626 ::testing::StaticAssertTypeEq<typename std::iterator_traits<typename vec::iterator>::difference_type,
std::ptrdiff_t>(
628 ::testing::StaticAssertTypeEq<
632 ::testing::StaticAssertTypeEq<typename std::iterator_traits<typename vec::const_iterator>::value_type, TypeParam>();
634 StaticAssertTypeEq<typename std::iterator_traits<typename vec::const_iterator>::reference, TypeParam
const&>();
635 ::testing::StaticAssertTypeEq<typename std::iterator_traits<typename vec::const_iterator>::pointer, TypeParam
const*>(
638 StaticAssertTypeEq<typename std::iterator_traits<typename vec::const_iterator>::difference_type,
std::ptrdiff_t>(
640 ::testing::StaticAssertTypeEq<
647 using vec =
typename TestFixture::vector;
648 ::testing::StaticAssertTypeEq<typename vec::value_type, TypeParam>();
649 ::testing::StaticAssertTypeEq<typename vec::pointer, TypeParam*>();
650 ::testing::StaticAssertTypeEq<typename vec::const_pointer, TypeParam const*>();
651 ::testing::StaticAssertTypeEq<typename vec::reference, TypeParam&>();
652 ::testing::StaticAssertTypeEq<typename vec::const_reference, TypeParam const&>();
653 ::testing::StaticAssertTypeEq<typename vec::size_type, std::size_t>();
654 ::testing::StaticAssertTypeEq<typename vec::difference_type, std::ptrdiff_t>();
656 StaticAssertTypeEq<typename vec::reverse_iterator, ::arene::base::reverse_iterator<typename vec::iterator>>();
657 ::testing::StaticAssertTypeEq<
658 typename vec::const_reverse_iterator,
662template <
typename Vec,
typename... Args>
668 auto val_it = values.
begin();
669 for (
auto const& vec_val : vec) {
670 if (val_it == values.end()) {
673 if (vec_val != *val_it) {
679 return val_it == values.end();
686 TypeParam
const value1 = TestFixture::test_value(0);
687 TypeParam
const value2 = TestFixture::test_value(1);
688 TypeParam
const value3 = TestFixture::test_value(2);
689 TypeParam
const value4 = TestFixture::test_value(3);
691 typename TestFixture::vector vec{TestFixture::standard_storage, {value1, value2, value3, value4}};
695 typename TestFixture::vector::iterator>::value);
696 auto const pos = vec.erase(vec.begin());
697 EXPECT_EQ(pos, vec.begin());
698 EXPECT_EQ(vec.size(), 3);
699 EXPECT_EQ(vec[0], value2);
700 EXPECT_EQ(vec[1], value3);
701 EXPECT_EQ(vec[2], value4);
708 TypeParam
const value1 = TestFixture::test_value(0);
709 TypeParam
const value2 = TestFixture::test_value(1);
710 TypeParam
const value3 = TestFixture::test_value(2);
711 TypeParam
const value4 = TestFixture::test_value(3);
713 typename TestFixture::vector vec{TestFixture::standard_storage, {value1, value2, value3, value4}};
717 typename TestFixture::vector::iterator>::value);
718 auto pos = vec.erase(vec.begin() + 1);
719 EXPECT_EQ(pos, vec.begin() + 1);
720 EXPECT_EQ(vec.size(), 3);
721 EXPECT_EQ(vec[0], value1);
722 EXPECT_EQ(vec[1], value3);
723 EXPECT_EQ(vec[2], value4);
730 auto vec = TestFixture::construct(TestFixture::standard_storage);
734 std::vector<TypeParam> expected;
736 vec.push_back(TestFixture::test_value(idx));
737 if (idx < erase_start || idx >= erase_end) {
738 expected.push_back(TestFixture::test_value(idx));
742 ::testing::StaticAssertTypeEq<
747 typename TestFixture::vector::iterator>();
748 auto const pos = vec.erase(vec.begin() + erase_start, vec.begin() + erase_end);
749 EXPECT_EQ(pos, vec.begin() + erase_start);
750 EXPECT_THAT(vec, ::testing::ElementsAreArray(expected));
756 auto value_vec = TestFixture::construct(TestFixture::standard_storage, count);
759 noexcept(
typename TestFixture::vector(TestFixture::standard_storage, count)),
762 EXPECT_EQ(value_vec.size(), count);
763 EXPECT_THAT(value_vec, ::testing::Each(::testing::Eq(TypeParam{})));
770 TypeParam
const value = TestFixture::test_value(0);
771 auto const value_vec = TestFixture::construct(TestFixture::standard_storage, count, value);
774 noexcept(
typename TestFixture::vector(TestFixture::standard_storage, count, value)),
777 EXPECT_EQ(value_vec.size(), count);
778 EXPECT_THAT(value_vec, ::testing::Each(::testing::Eq(value)));
783 auto const vec = TestFixture::test_external_vector(TestFixture::standard_storage, 6);
784 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
786 typename TestFixture::vector
const copy(storage2, vec);
788 EXPECT_THAT(
copy, ::testing::ElementsAreArray(vec));
794 TestFixture::test_value(0),
795 TestFixture::test_value(1),
796 TestFixture::test_value(2),
797 TestFixture::test_value(3),
798 TestFixture::test_value(4)
800 typename TestFixture::vector vec(TestFixture::standard_storage, values);
802 typename TestFixture::vector
const moved(
std::move(vec));
804 EXPECT_THAT(moved, ::testing::ElementsAreArray(values));
810 TestFixture::test_value(0),
811 TestFixture::test_value(1),
812 TestFixture::test_value(2),
813 TestFixture::test_value(3),
814 TestFixture::test_value(4)
816 typename TestFixture::vector vec(TestFixture::standard_storage, values);
818 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
820 typename TestFixture::vector
const moved(storage2,
std::move(vec));
822 EXPECT_THAT(moved, ::testing::ElementsAreArray(values));
832 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
833 auto vec = TestFixture::test_external_vector(TestFixture::standard_storage, count);
834 auto copy = TestFixture::test_external_vector(storage2, smaller_count);
837 ASSERT_EQ(vec.size(), count);
838 ASSERT_EQ(
copy.size(), count);
840 EXPECT_EQ(vec[i],
copy[i]);
841 EXPECT_EQ(TestFixture::test_value(i),
copy[i]);
851 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
852 auto vec = TestFixture::test_external_vector(TestFixture::standard_storage, count);
853 auto copy = TestFixture::test_external_vector(storage2, larger_count);
856 ASSERT_EQ(vec.size(), count);
857 ASSERT_EQ(
copy.size(), count);
859 EXPECT_EQ(vec[i],
copy[i]);
860 EXPECT_EQ(TestFixture::test_value(i),
copy[i]);
873 constexpr bool should_be_noexcept =
886 auto first = TestFixture::construct(TestFixture::standard_storage);
887 std::vector<TypeParam> expected;
889 first.push_back(TestFixture::test_value(idx));
890 expected.push_back(TestFixture::test_value(idx));
893 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
894 auto second = TestFixture::test_external_vector(storage2, smaller_count);
898 EXPECT_EQ(second.size(), count);
899 EXPECT_THAT(second, ::testing::ElementsAreArray(expected));
908 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
909 auto first = TestFixture::test_external_vector(TestFixture::standard_storage, count);
910 auto second = TestFixture::test_external_vector(storage2, larger_count);
913 ASSERT_EQ(second.size(), count);
915 EXPECT_EQ(TestFixture::test_value(i), second[i]);
928 constexpr bool should_be_noexcept =
938 if (arg[ii] != function(ii)) {
948 auto vec = TestFixture::test_external_vector(TestFixture::standard_storage, 5);
950 vec.push_back(TestFixture::test_value(5));
953 EXPECT_THAT(vec, elements_match_function(TestFixture::test_value));
964 auto vec = TestFixture::construct(TestFixture::standard_storage);
967 STATIC_ASSERT_TRUE(
noexcept(vec.erase(vec.begin(), vec.end())));
968 STATIC_ASSERT_TRUE(
noexcept(vec.erase(vec.begin())));
974 TypeParam
const value = TestFixture::test_value(0);
975 auto vec1 = TestFixture::construct(TestFixture::standard_storage);
976 auto const& const_vec1 = vec1;
977 auto const itr = vec1.insert(const_vec1.begin(), value);
978 EXPECT_EQ(itr, vec1.begin());
979 EXPECT_EQ(vec1.size(), 1);
980 EXPECT_EQ(vec1[0], value);
986 TypeParam
const value0 = TestFixture::test_value(0);
987 TypeParam
const value1 = TestFixture::test_value(1);
988 typename TestFixture::vector vec1{TestFixture::standard_storage, {value0}};
989 auto const& const_vec1 = vec1;
990 auto const pos = vec1.insert(const_vec1.end(), value1);
991 EXPECT_EQ(pos, vec1.begin() + 1);
992 EXPECT_EQ(vec1.size(), 2);
993 EXPECT_EQ(vec1[0], value0);
994 EXPECT_EQ(vec1[1], value1);
1001 TypeParam
const value0 = TestFixture::test_value(0);
1002 TypeParam
const value1 = TestFixture::test_value(1);
1003 TypeParam
const value2 = TestFixture::test_value(2);
1004 TypeParam
const value3 = TestFixture::test_value(3);
1005 TypeParam
const value4 = TestFixture::test_value(4);
1006 typename TestFixture::vector vec1{TestFixture::standard_storage, {value0, value1, value2, value4}};
1007 auto const& const_vec1 = vec1;
1008 auto const pos = vec1.insert(const_vec1.begin() + 1, value3);
1009 EXPECT_EQ(pos, vec1.begin() + 1);
1010 EXPECT_EQ(vec1.size(), 5);
1011 EXPECT_EQ(vec1[0], value0);
1012 EXPECT_EQ(vec1[1], value3);
1013 EXPECT_EQ(vec1[2], value1);
1014 EXPECT_EQ(vec1[3], value2);
1015 EXPECT_EQ(vec1[4], value4);
1021 TypeParam
const value1 = TestFixture::test_value(0);
1022 TypeParam
const value2 = TestFixture::test_value(1);
1023 auto vec1 = TestFixture::construct(TestFixture::standard_storage, TestFixture::capacity, value1);
1024 EXPECT_EQ(vec1.size(), TestFixture::capacity);
1025 ASSERT_DEATH(vec1.insert(vec1.end(), value2),
"Precondition violation");
1026 ASSERT_DEATH(vec1.insert(vec1.begin(), value2),
"Precondition violation");
1027 EXPECT_EQ(vec1.size(), TestFixture::capacity);
1028 for (
auto& value : vec1) {
1029 EXPECT_EQ(value, value1);
1037 ConstructingWithOutOfRangeSizeIsPreconditionViolation,
1041 TestFixture::construct(TestFixture::standard_storage, TestFixture::capacity + 1),
1042 "Precondition violation"
1049 TypeParam
const source = TestFixture::test_value(0);
1051 TestFixture::construct(TestFixture::standard_storage, TestFixture::capacity + 1, source),
1052 "Precondition violation"
1061 TypeParam
const value = TestFixture::test_value(0);
1064 ASSERT_DEATH((vec{storage, {value, value, value, value, value}}),
"Precondition violation");
1067template <
typename Vec>
1076 ResizeIsConditionallyNoexcept,
1095 TypeParam
const initial_value = TestFixture::test_value(0);
1096 typename TestFixture::vector vec(TestFixture::standard_storage, initial_count, initial_value);
1098 TypeParam
const value = TestFixture::test_value(1);
1099 vec.resize(count, value);
1100 ASSERT_EQ(vec.size(), count);
1103 EXPECT_EQ(vec[idx], initial_value);
1113 TypeParam
const initial_value = TestFixture::test_value(0);
1114 typename TestFixture::vector vec(TestFixture::standard_storage, initial_count, initial_value);
1116 TypeParam
const value = TestFixture::test_value(1);
1117 vec.resize(count, value);
1118 ASSERT_EQ(vec.size(), count);
1120 for (
std::size_t idx = 0; idx < initial_count; ++idx) {
1121 EXPECT_EQ(vec[idx], initial_value);
1123 for (
std::size_t idx = initial_count; idx < count; ++idx) {
1124 EXPECT_EQ(vec[idx], value);
1131 auto const source = TestFixture::test_external_vector(TestFixture::standard_storage, 4);
1133 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
1134 typename TestFixture::vector vec(storage2, source.begin(), source.end());
1136 EXPECT_EQ(vec.size(), source.size());
1138 EXPECT_EQ(vec[i], source[i]);
1145 using source_it =
typename std::vector<TypeParam>::const_iterator;
1146 using source_val =
typename source_it::reference;
1149 constexpr bool element_construction_noexcept =
1152 STATIC_ASSERT_TRUE((
1157 typename TestFixture::vector,
1161 it_operations_noexcept && element_construction_noexcept
1164 using throws_when_converted =
typename TestFixture::throws_when_converted_to_t;
1166 using throwing_bidirectional_iterator =
typename TestFixture::throwing_bidirectional_iterator_of_t;
1169 typename TestFixture::vector,
1171 typename convertible_array::const_iterator,
1172 typename convertible_array::const_iterator>::value);
1174 typename TestFixture::vector,
1176 typename convertible_array::const_iterator,
1177 typename convertible_array::const_iterator>::value);
1179 typename TestFixture::vector,
1181 throwing_bidirectional_iterator,
1182 throwing_bidirectional_iterator>::value);
1184 typename TestFixture::vector,
1186 throwing_bidirectional_iterator,
1187 throwing_bidirectional_iterator>::value);
1193 using stream_it = std::istream_iterator<TypeParam>;
1194 using throws_when_converted =
typename TestFixture::throws_when_converted_to_t;
1201 constexpr bool element_construction_noexcept =
1204 STATIC_ASSERT_TRUE((
1209 typename TestFixture::vector,
1213 it_operations_noexcept && element_construction_noexcept
1217 typename TestFixture::vector,
1219 throwing_it_throwing_type,
1220 throwing_it_throwing_type>::value);
1222 typename TestFixture::vector,
1224 throwing_it_throwing_type,
1225 throwing_it_throwing_type>::value);
1227 typename TestFixture::vector,
1229 throwing_it_raw_type,
1230 throwing_it_raw_type>::value);
1232 typename TestFixture::vector,
1234 throwing_it_raw_type,
1235 throwing_it_raw_type>::value);
1237 typename TestFixture::vector,
1239 nothrow_it_raw_type,
1240 nothrow_it_raw_type>::value);
1243 typename TestFixture::vector,
1245 nothrow_it_raw_type,
1246 nothrow_it_raw_type>::value),
1250 typename TestFixture::vector,
1252 nothrow_it_throwing_type,
1253 nothrow_it_throwing_type>::value);
1255 typename TestFixture::vector,
1257 nothrow_it_throwing_type,
1258 nothrow_it_throwing_type>::value);
1268 TestFixture::test_value(0),
1269 TestFixture::test_value(1),
1270 TestFixture::test_value(2),
1271 TestFixture::test_value(3),
1272 TestFixture::test_value(4),
1273 TestFixture::test_value(5),
1274 TestFixture::test_value(6),
1275 TestFixture::test_value(7),
1276 TestFixture::test_value(8),
1277 TestFixture::test_value(9),
1278 TestFixture::test_value(10),
1279 TestFixture::test_value(11),
1280 TestFixture::test_value(12),
1281 TestFixture::test_value(13)
1284 auto copy = TestFixture::test_external_vector(TestFixture::standard_storage, smaller_count);
1287 EXPECT_THAT(
copy, ::testing::ElementsAreArray(value));
1298 TestFixture::test_value(0),
1299 TestFixture::test_value(1),
1300 TestFixture::test_value(2),
1301 TestFixture::test_value(3),
1302 TestFixture::test_value(4),
1303 TestFixture::test_value(5),
1304 TestFixture::test_value(6),
1305 TestFixture::test_value(7),
1306 TestFixture::test_value(8),
1307 TestFixture::test_value(9),
1308 TestFixture::test_value(10),
1309 TestFixture::test_value(11),
1310 TestFixture::test_value(12),
1311 TestFixture::test_value(13)
1315 auto copy = TestFixture::test_external_vector(storage, larger_count);
1318 EXPECT_THAT(
copy, ::testing::ElementsAreArray(value));
1324 std::vector<TypeParam>
const source{
1325 TestFixture::test_value(3),
1326 TestFixture::test_value(4),
1327 TestFixture::test_value(5),
1328 TestFixture::test_value(6)
1331 auto vec = TestFixture::test_external_vector(TestFixture::standard_storage, 3);
1332 vec.assign(source.begin(), source.end());
1334 EXPECT_THAT(vec, ::testing::ElementsAreArray(source));
1341 using throws_when_converted =
typename TestFixture::throws_when_converted_to_t;
1343 using throwing_bidirectional_iterator =
typename TestFixture::throwing_bidirectional_iterator_of_t;
1346 constexpr bool element_construction_noexcept =
1353 it_operations_noexcept && element_construction_noexcept
1372 TestFixture::test_value(0),
1373 TestFixture::test_value(1),
1374 TestFixture::test_value(2),
1375 TestFixture::test_value(3),
1376 TestFixture::test_value(4),
1377 TestFixture::test_value(5),
1378 TestFixture::test_value(6),
1379 TestFixture::test_value(7),
1380 TestFixture::test_value(8),
1381 TestFixture::test_value(9),
1382 TestFixture::test_value(10),
1383 TestFixture::test_value(11),
1384 TestFixture::test_value(12),
1385 TestFixture::test_value(13)
1388 auto copy = TestFixture::test_external_vector(TestFixture::standard_storage, smaller_count);
1391 EXPECT_THAT(
copy, ::testing::ElementsAreArray(value));
1397 constexpr bool is_nothrow_copyable =
1401 TestFixture::test_value(0),
1402 TestFixture::test_value(1),
1403 TestFixture::test_value(2),
1404 TestFixture::test_value(3),
1405 TestFixture::test_value(4),
1406 TestFixture::test_value(5),
1407 TestFixture::test_value(6),
1408 TestFixture::test_value(7),
1409 TestFixture::test_value(8),
1410 TestFixture::test_value(9),
1411 TestFixture::test_value(10),
1412 TestFixture::test_value(11),
1413 TestFixture::test_value(12),
1414 TestFixture::test_value(13)
1416 STATIC_ASSERT_EQ(
noexcept(
typename TestFixture::vector{}.assign(values)), is_nothrow_copyable);
1423 std::vector<TypeParam>
const source{
1424 TestFixture::test_value(3),
1425 TestFixture::test_value(4),
1426 TestFixture::test_value(5),
1427 TestFixture::test_value(6)
1430 auto vec = TestFixture::test_external_vector(TestFixture::standard_storage, 3);
1431 vec.assign(source.begin(), source.end());
1433 EXPECT_THAT(vec, ::testing::ElementsAreArray(source));
1439 using throws_when_converted =
typename TestFixture::throws_when_converted_to_t;
1445 STATIC_ASSERT_FALSE(
noexcept(
typename TestFixture::vector{}.assign(
1449 STATIC_ASSERT_FALSE(
noexcept(
typename TestFixture::vector{}.assign(
1453 STATIC_ASSERT_FALSE(
noexcept(
1457 noexcept(
typename TestFixture::vector{}
1461 STATIC_ASSERT_FALSE(
noexcept(
typename TestFixture::vector{}.assign(
1473 auto copy = TestFixture::test_external_vector(TestFixture::standard_storage, smaller_count);
1474 TypeParam
const value = TestFixture::test_value(0);
1475 copy.assign(count, value);
1477 EXPECT_EQ(
copy.size(), count);
1479 EXPECT_EQ(
copy[i], value);
1487 TypeParam
const value = TestFixture::test_value(0);
1489 constexpr bool is_nothrow_copyable =
1491 STATIC_ASSERT_EQ(
noexcept(
typename TestFixture::vector{}.assign(count, value)), is_nothrow_copyable);
1499 TypeParam
const initial_value = TestFixture::test_value(0);
1500 typename TestFixture::vector
copy(TestFixture::standard_storage, smaller_count, initial_value);
1501 TypeParam
const value = TestFixture::test_value(1);
1502 ASSERT_DEATH(
copy.assign(TestFixture::capacity + 1, value),
"Precondition violation");
1504 EXPECT_EQ(
copy.size(), smaller_count);
1506 EXPECT_EQ(
copy[i], initial_value);
1512 ::testing::StaticAssertTypeEq<decltype(std::declval<typename TestFixture::vector&>()[0]), TypeParam&>();
1517 ::testing::StaticAssertTypeEq<decltype(std::declval<typename TestFixture::vector const&>()[0]), TypeParam
const&>();
1523 auto vec = TestFixture::construct(TestFixture::standard_storage);
1524 auto const& const_vec = vec;
1525 TypeParam
const value1 = TestFixture::test_value(0);
1526 vec.push_back(value1);
1527 TypeParam
const value2 = TestFixture::test_value(1);
1528 vec.push_back(value2);
1530 EXPECT_EQ(vec[0], value1);
1531 EXPECT_EQ(vec[1], value2);
1545 ASSERT_DEATH(TestFixture::construct()[0],
"index < this->size()");
1555 typename TestFixture::vector vec{
1556 TestFixture::standard_storage,
1557 {TestFixture::test_value(3), TestFixture::test_value(4)}
1559 auto const& const_vec = vec;
1566 STATIC_ASSERT_TRUE(
noexcept(vec.data()));
1567 STATIC_ASSERT_TRUE(
noexcept(const_vec.data()));
1569 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
1570 auto const value2 = TestFixture::test_external_vector(storage2, 3);
1574 alignas(TypeParam)
typename TestFixture::standard_storage_type storage3{};
1575 ASSERT_NE(TestFixture::test_external_vector(storage3, 3).data(),
nullptr);
1580 auto vec = TestFixture::test_external_vector(TestFixture::standard_storage, 2);
1582 EXPECT_EQ(vec.size(), 2);
1583 EXPECT_FALSE(vec.empty());
1585 EXPECT_EQ(vec.size(), 0);
1586 EXPECT_TRUE(vec.empty());
1588 STATIC_ASSERT_TRUE(
noexcept(vec.clear()));
1595template <
typename Container>
1598 for (
std::size_t ii = 0UL; ii + 1UL < container.size(); ++ii) {
1599 for (
std::size_t jj = ii + 1UL; jj < container.size(); ++jj) {
1600 if (container[ii] == container[jj]) {
1613template <
typename Container>
1618 for (
std::size_t ii = 0UL; ii + 1UL < container.size(); ++ii) {
1619 if (container[ii + 1] < container[ii]) {
1621 typename Container::value_type
const temp{container[ii]};
1622 container[ii] = container[ii + 1];
1623 container[ii + 1] = temp;
1633template <
typename T>
1673 struct with_constructor_args {
1676 TypeParam& reference;
1677 std::unique_ptr<TypeParam> pointer;
1679 with_constructor_args(TypeParam val, TypeParam& ref, std::unique_ptr<TypeParam> ptr)
1685 alignas(with_constructor_args)
1690 TypeParam
const value1 = TestFixture::test_value(0);
1691 TypeParam value2 = TestFixture::test_value(1);
1692 TypeParam
const value3 = TestFixture::test_value(2);
1693 auto&
result = vec.emplace_back(value1, value2, std::make_unique<TypeParam>(value3));
1695 ::testing::StaticAssertTypeEq<decltype(result), with_constructor_args&>();
1696 EXPECT_EQ(vec.size(), 1);
1697 ASSERT_FALSE(vec.empty());
1702 ASSERT_NE(
result.pointer,
nullptr);
1703 EXPECT_EQ(*
result.pointer, value3);
1706template <
typename T>
1724 STATIC_ASSERT_FALSE(
1735 using const_it =
typename TestFixture::vector::const_iterator;
1737 constexpr bool is_nothrow_movable =
1750 using overload_it =
typename overload_test_external_vector::const_iterator;
1751 STATIC_ASSERT_FALSE(
1764 DefaultEmplaceIsConditionallyNoexcept,
1767 using const_it =
typename TestFixture::vector::const_iterator;
1769 constexpr bool is_nothrow_movable =
1773 noexcept(TestFixture::construct().emplace_back()),
1778 is_nothrow_movable && std::is_nothrow_default_constructible<TypeParam>{}
1785 auto vec = TestFixture::test_external_vector(TestFixture::standard_storage, TestFixture::capacity);
1787 TypeParam
const value1 = TestFixture::test_value(0);
1788 ASSERT_DEATH(vec.emplace_back(value1),
"Precondition violation");
1794 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
1795 auto const source1 = TestFixture::test_external_vector(TestFixture::standard_storage, 12);
1796 auto const source2 = TestFixture::test_external_vector(storage2, 12, 16);
1797 alignas(TypeParam)
typename TestFixture::standard_storage_type storage3{};
1798 alignas(TypeParam)
typename TestFixture::standard_storage_type storage4{};
1799 typename TestFixture::vector value1(storage3, source1);
1800 typename TestFixture::vector value2(storage4, source2);
1802 swap(value1, value2);
1804 EXPECT_EQ(value1, source2);
1805 EXPECT_EQ(value2, source1);
1810 using vec =
typename TestFixture::vector;
1820 using vec =
typename TestFixture::vector;
1821 using iterator =
typename vec::const_iterator;
1823 constexpr bool is_nothrow_movable =
1836 using vec =
typename TestFixture::vector;
1837 using iterator =
typename vec::const_iterator;
1839 constexpr bool is_nothrow_movable =
1855 struct with_constructor_args {
1857 TypeParam* raw_pointer;
1858 std::unique_ptr<TypeParam> unique_pointer;
1860 with_constructor_args(TypeParam val, TypeParam* rptr, std::unique_ptr<TypeParam> uptr)
1866 alignas(with_constructor_args)
1870 auto const& const_vec1 = vec;
1871 TypeParam
const value1 = TestFixture::test_value(0);
1872 TypeParam value2 = TestFixture::test_value(1);
1873 TypeParam
const value3 = TestFixture::test_value(2);
1874 auto pos = vec.emplace(const_vec1.begin(), value1,
std::addressof(value2), std::make_unique<TypeParam>(value3));
1875 EXPECT_EQ(pos, vec.begin());
1876 EXPECT_EQ(vec.size(), 1);
1879 EXPECT_EQ(pos->value, value1);
1880 ASSERT_NE(pos->raw_pointer,
nullptr);
1882 ASSERT_NE(pos->unique_pointer,
nullptr);
1883 EXPECT_EQ(*pos->unique_pointer, value3);
1889 auto value = TestFixture::test_external_vector(TestFixture::standard_storage, 4);
1891 value.insert(value.begin(), (TestFixture::capacity + 1) - value.size(), TestFixture::test_value(5)),
1892 "Precondition violation"
1894 EXPECT_EQ(value.size(), 4);
1900 TypeParam
const value1 = TestFixture::test_value(0);
1901 TypeParam
const value2 = TestFixture::test_value(1);
1902 TypeParam
const value3 = TestFixture::test_value(2);
1903 typename TestFixture::vector vec{TestFixture::standard_storage, {value1, value2}};
1906 vec.insert(vec.end(), count, value3);
1907 EXPECT_EQ(vec.size(), count + 2);
1908 EXPECT_EQ(vec[0], value1);
1909 EXPECT_EQ(vec[1], value2);
1911 EXPECT_EQ(vec[i + 2], value3);
1919 TypeParam
const value1 = TestFixture::test_value(0);
1920 TypeParam
const value2 = TestFixture::test_value(1);
1921 TypeParam
const value3 = TestFixture::test_value(2);
1922 TypeParam
const value4 = TestFixture::test_value(3);
1923 TypeParam
const value_inserted = TestFixture::test_value(4);
1924 typename TestFixture::vector vec{TestFixture::standard_storage, {value1, value2, value3, value4}};
1927 vec.insert(vec.begin() + 1, count, value_inserted);
1928 EXPECT_EQ(vec.size(), count + 4);
1929 EXPECT_EQ(vec[0], value1);
1931 EXPECT_EQ(vec[i + 1], value_inserted);
1933 EXPECT_EQ(vec[count + 1], value2);
1934 EXPECT_EQ(vec[count + 2], value3);
1935 EXPECT_EQ(vec[count + 3], value4);
1942 TypeParam
const value1 = TestFixture::test_value(0);
1943 TypeParam
const value2 = TestFixture::test_value(1);
1944 TypeParam
const value3 = TestFixture::test_value(2);
1945 TypeParam
const value4 = TestFixture::test_value(3);
1946 auto vec1 = TestFixture::test_external_vector(TestFixture::standard_storage, 4);
1947 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
1948 auto const vec2 = TestFixture::test_external_vector(storage2, 4, 11);
1950 vec1.insert(vec1.begin() + 1, vec2.begin(), vec2.end());
1951 EXPECT_EQ(vec1.size(), vec2.size() + 4);
1952 EXPECT_EQ(vec1[0], value1);
1953 for (
std::size_t idx = 0; idx < vec2.size(); ++idx) {
1954 EXPECT_EQ(vec1[idx + 1], vec2[idx]);
1956 EXPECT_EQ(vec1[vec2.size() + 1], value2);
1957 EXPECT_EQ(vec1[vec2.size() + 2], value3);
1958 EXPECT_EQ(vec1[vec2.size() + 3], value4);
1964 using ivec_iter =
typename TestFixture::vector::const_iterator;
1966 using throws_when_converted =
typename TestFixture::throws_when_converted_to_t;
1973 constexpr bool is_nothrow_movable =
1985 STATIC_ASSERT_FALSE(
noexcept(this->
construct().insert(
1999 STATIC_ASSERT_FALSE(
noexcept(this->
construct().insert(
2004 STATIC_ASSERT_FALSE(
noexcept(this->
construct().insert(
2009 STATIC_ASSERT_FALSE(
noexcept(this->
construct().insert(
2014 STATIC_ASSERT_FALSE(
noexcept(this->
construct().insert(
2023 auto const value1 = TestFixture::test_external_vector(TestFixture::standard_storage, 4);
2025 ASSERT_EQ(value1.cbegin(), value1.begin());
2026 ASSERT_EQ(value1.cend(), value1.end());
2028 ::testing::StaticAssertTypeEq<
decltype(value1.cbegin()),
typename TestFixture::vector::const_iterator>();
2029 STATIC_ASSERT_TRUE(
noexcept(value1.cbegin()));
2030 STATIC_ASSERT_TRUE(
noexcept(value1.cend()));
2032 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
2033 auto value2 = TestFixture::test_external_vector(storage2, 4);
2034 ::testing::StaticAssertTypeEq<
decltype(value2.cbegin()),
typename TestFixture::vector::const_iterator>();
2035 ::testing::StaticAssertTypeEq<
decltype(value2.cend()),
typename TestFixture::vector::const_iterator>();
2037 EXPECT_EQ(value2.begin(), value2.cbegin());
2038 EXPECT_EQ(value2.end(), value2.cend());
2045 auto const value1 = TestFixture::test_external_vector(TestFixture::standard_storage, 4);
2047 auto itr = value1.rbegin();
2048 ASSERT_NE(itr, value1.rend());
2049 EXPECT_EQ(*itr, value1[3]);
2051 ASSERT_NE(itr, value1.rend());
2052 EXPECT_EQ(*itr, value1[2]);
2054 ASSERT_NE(itr, value1.rend());
2055 EXPECT_EQ(*itr, value1[1]);
2057 ASSERT_NE(itr, value1.rend());
2058 EXPECT_EQ(*itr, value1[0]);
2060 ASSERT_EQ(itr, value1.rend());
2062 auto citr = value1.crbegin();
2063 ASSERT_NE(citr, value1.crend());
2064 EXPECT_EQ(*citr, value1[3]);
2066 ASSERT_NE(citr, value1.crend());
2067 EXPECT_EQ(*citr, value1[2]);
2069 ASSERT_NE(citr, value1.crend());
2070 EXPECT_EQ(*citr, value1[1]);
2072 ASSERT_NE(citr, value1.crend());
2073 EXPECT_EQ(*citr, value1[0]);
2075 ASSERT_EQ(citr, value1.crend());
2081 constexpr std::size_t larger_capacity = TestFixture::capacity + 2UL;
2085 {TestFixture::test_value(0),
2086 TestFixture::test_value(1),
2087 TestFixture::test_value(2),
2088 TestFixture::test_value(3),
2089 TestFixture::test_value(4)}
2093 typename TestFixture::vector small_vector(storage2, large_vector);
2094 small_vector = large_vector;
2096 EXPECT_EQ(small_vector.size(), large_vector.size());
2097 for (
std::size_t i = 0; i < small_vector.size(); ++i) {
2098 EXPECT_EQ(small_vector[i], large_vector[i]);
2104 using vec =
typename TestFixture::vector;
2106 STATIC_ASSERT_TRUE(
noexcept(vec::try_construct()));
2108 ASSERT_TRUE(vec::try_construct().has_value());
2109 ASSERT_TRUE(vec::try_construct()->
empty());
2115 CanConstructWithSizeViaTryConstruct,
2118 using vec =
typename TestFixture::vector;
2124 STATIC_ASSERT_TRUE(
noexcept(vec::try_construct(TestFixture::standard_storage, size1)));
2126 ASSERT_TRUE(vec::try_construct(TestFixture::standard_storage, size1).has_value());
2127 ASSERT_FALSE(vec::try_construct(TestFixture::standard_storage, size1)->
empty());
2128 ASSERT_EQ(vec::try_construct(TestFixture::standard_storage, size1)->
size(), size1);
2135 ConstructWithExcessiveSizeViaTryConstructFails,
2138 using vec =
typename TestFixture::vector;
2139 constexpr std::size_t size1 = TestFixture::capacity + 1;
2144 STATIC_ASSERT_TRUE(
noexcept(vec::try_construct(TestFixture::standard_storage, size1)));
2146 ASSERT_FALSE(vec::try_construct(TestFixture::standard_storage, size1).has_value());
2154 typename TestFixture::vector,
2172 using ivec =
typename TestFixture::vector;
2173 STATIC_ASSERT_TRUE(
noexcept(ivec::try_construct()));
2174 STATIC_ASSERT_TRUE(
noexcept(ivec{}));
2176 ASSERT_TRUE(ivec::try_construct().has_value());
2177 ASSERT_TRUE(ivec::try_construct()->
empty());
2178 ASSERT_TRUE(ivec().
empty());
2184 using ivec =
typename TestFixture::vector;
2185 STATIC_ASSERT_TRUE(
noexcept(ivec::try_construct(TestFixture::standard_storage)));
2186 STATIC_ASSERT_TRUE(
noexcept(ivec{TestFixture::standard_storage}));
2188 ASSERT_TRUE(ivec::try_construct(TestFixture::standard_storage).has_value());
2189 ASSERT_TRUE(ivec::try_construct(TestFixture::standard_storage)->
empty());
2190 ASSERT_TRUE(ivec(TestFixture::standard_storage).
empty());
2197 ConstructWithSizeViaTryConstructNotNoexceptIfDefaultConstructorNotNoexcept,
2200 using ivec =
typename TestFixture::vector;
2203 decltype(ivec::try_construct(TestFixture::standard_storage, small_size)),
2206 noexcept(ivec::try_construct(TestFixture::standard_storage, small_size)),
2215 ConstructWithSizeViaNormalConstructWithDefaultConstructorNotNoexceptIsNotNoexcept,
2218 using ivec =
typename TestFixture::vector;
2219 constexpr std::size_t size1 = TestFixture::capacity - 1;
2221 noexcept(ivec(TestFixture::standard_storage, size1)),
2230 ConstructWithExcessiveSizeViaNormalConstructIsAlwaysPreconditionViolation,
2233 constexpr std::size_t size1 = TestFixture::capacity + 1;
2235 this->
construct(TestFixture::standard_storage, size1),
2236 "Precondition violation"
2243 using ivec =
typename TestFixture::vector;
2264 TestFixture::test_value(0),
2265 TestFixture::test_value(1),
2266 TestFixture::test_value(2),
2267 TestFixture::test_value(3)
2271 noexcept(TestFixture::vector::try_construct(TestFixture::standard_storage, values)),
2274 ASSERT_TRUE(TestFixture::vector::try_construct(TestFixture::standard_storage, values).has_value());
2275 ASSERT_EQ(TestFixture::vector::try_construct(TestFixture::standard_storage, values)->
size(), values.size());
2277 auto res = TestFixture::vector::try_construct(TestFixture::standard_storage, values);
2278 EXPECT_THAT(*res, ::testing::ElementsAreArray(values));
2285 TestFixture::test_value(0), TestFixture::test_value(1), TestFixture::test_value(2),
2286 TestFixture::test_value(3), TestFixture::test_value(4), TestFixture::test_value(5),
2287 TestFixture::test_value(6), TestFixture::test_value(7), TestFixture::test_value(8),
2288 TestFixture::test_value(9), TestFixture::test_value(10), TestFixture::test_value(11),
2289 TestFixture::test_value(12), TestFixture::test_value(13), TestFixture::test_value(14),
2290 TestFixture::test_value(15), TestFixture::test_value(16), TestFixture::test_value(17),
2291 TestFixture::test_value(18), TestFixture::test_value(19), TestFixture::test_value(20),
2292 TestFixture::test_value(21), TestFixture::test_value(22), TestFixture::test_value(23),
2293 TestFixture::test_value(24), TestFixture::test_value(25)
2296 ASSERT_GT(values.size(), TestFixture::capacity);
2297 ASSERT_FALSE(TestFixture::vector::try_construct(TestFixture::standard_storage, values).has_value());
2302 using ivec =
typename TestFixture::vector;
2303 auto const values = TestFixture::test_external_vector(TestFixture::standard_storage);
2305 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
2312 noexcept(ivec::try_construct(storage2, values)),
2315 auto res = ivec::try_construct(storage2, values);
2316 ASSERT_TRUE(res.has_value());
2317 EXPECT_THAT(*res, ::testing::ElementsAreArray(values));
2323 auto const values = TestFixture::test_external_vector(TestFixture::standard_storage);
2325 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
2327 noexcept(
typename TestFixture::vector(storage2, values)),
2330 auto res = this->
construct(storage2, values);
2331 EXPECT_THAT(res, ::testing::ElementsAreArray(values));
2337 using ivec =
typename TestFixture::vector;
2338 constexpr std::size_t smaller_capacity = TestFixture::capacity - 1;
2345 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
2352 noexcept(ivec::try_construct(storage2, values)),
2355 auto res = ivec::try_construct(storage2, values);
2356 ASSERT_TRUE(res.has_value());
2357 EXPECT_THAT(*res, ::testing::ElementsAreArray(values));
2363 constexpr std::size_t smaller_capacity = TestFixture::capacity - 1;
2367 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
2369 noexcept(
typename TestFixture::vector(storage2, values)),
2372 auto res = this->
construct(storage2, values);
2373 EXPECT_THAT(res, ::testing::ElementsAreArray(values));
2380 using ivec =
typename TestFixture::vector;
2381 constexpr std::size_t larger_capacity = TestFixture::capacity + 1;
2385 auto const values = TestFixture::test_external_vector(storage, 0, TestFixture::capacity);
2387 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
2394 noexcept(ivec::try_construct(storage2, values)),
2397 auto res = ivec::try_construct(storage2, values);
2398 ASSERT_TRUE(res.has_value());
2399 EXPECT_THAT(*res, ::testing::ElementsAreArray(values));
2405 constexpr std::size_t larger_capacity = TestFixture::capacity + 1;
2409 auto const values = TestFixture::test_external_vector(storage, 0, larger_capacity);
2411 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
2412 EXPECT_GT(values.size(), TestFixture::capacity);
2413 EXPECT_FALSE(TestFixture::vector::try_construct(storage2, values).has_value());
2419 constexpr std::size_t larger_capacity = TestFixture::capacity + 1;
2421 auto const values = TestFixture::test_external_vector(storage, 0, TestFixture::capacity);
2424 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
2425 STATIC_ASSERT_EQ(
noexcept(
typename TestFixture::vector(storage2, values)), copy_is_noexcept);
2426 auto res = this->
construct(storage2, values);
2427 EXPECT_THAT(res, ::testing::ElementsAreArray(values));
2432 using ivec =
typename TestFixture::vector;
2435 STATIC_ASSERT_FALSE(
2443 using ivec =
typename TestFixture::vector;
2456 auto const values = TestFixture::test_external_vector(TestFixture::standard_storage);
2457 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
2458 typename TestFixture::vector values_copy(storage2, values);
2462 typename TestFixture::vector,
2463 typename TestFixture::vector&&>);
2465 noexcept(TestFixture::vector::try_construct(
std::move(values_copy))),
2468 auto res = TestFixture::vector::try_construct(
std::move(values_copy));
2469 ASSERT_TRUE(res.has_value());
2470 EXPECT_THAT(*res, ::testing::ElementsAreArray(values));
2476 auto const values = TestFixture::test_external_vector(TestFixture::standard_storage);
2478 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
2479 typename TestFixture::vector source(storage2, values);
2481 STATIC_ASSERT_TRUE(
noexcept(
typename TestFixture::vector(
std::move(source))));
2484 EXPECT_THAT(res, ::testing::ElementsAreArray(values));
2490 constexpr std::size_t larger_capacity = TestFixture::capacity + 1;
2494 auto values = TestFixture::test_external_vector(storage, TestFixture::capacity + 1);
2496 ASSERT_GT(values.size(), TestFixture::capacity);
2520 auto const source = TestFixture::test_external_vector(TestFixture::standard_storage, 5);
2522 alignas(TypeParam)
typename TestFixture::standard_storage_type storage2{};
2523 auto maybe_vec = TestFixture::vector::try_construct(storage2, source.begin(), source.end());
2524 ASSERT_TRUE(maybe_vec.has_value());
2526 ASSERT_EQ(maybe_vec->size(), source.size());
2527 for (
std::size_t i = 0; i < maybe_vec->size(); ++i) {
2528 EXPECT_EQ((*maybe_vec)[i], source[i]);
2536 using throws_when_converted =
typename TestFixture::throws_when_converted_to_t;
2538 using throwing_bidirectional_iterator =
typename TestFixture::throwing_bidirectional_iterator_of_t;
2541 noexcept(TestFixture::vector::try_construct(
2548 STATIC_ASSERT_FALSE(
noexcept(TestFixture::vector::try_construct(
2553 STATIC_ASSERT_FALSE(
noexcept(TestFixture::vector::try_construct(
2563 using throws_when_converted =
typename TestFixture::throws_when_converted_to_t;
2569 STATIC_ASSERT_FALSE(
noexcept(TestFixture::vector::try_construct(
2574 STATIC_ASSERT_FALSE(
noexcept(TestFixture::vector::try_construct(
2579 STATIC_ASSERT_FALSE(
noexcept(TestFixture::vector::try_construct(
2585 noexcept(TestFixture::vector::try_construct(
2592 STATIC_ASSERT_FALSE(
noexcept(TestFixture::vector::try_construct(
2602 ASSERT_DEATH(
std::ignore = *
typename TestFixture::vector::iterator{},
"Precondition violation");
2603 ASSERT_DEATH(
std::ignore = *
typename TestFixture::vector::const_iterator{},
"Precondition violation");
2609 ASSERT_DEATH(
std::ignore =
typename TestFixture::vector::iterator{} + 1,
"Precondition violation");
2610 ASSERT_DEATH(
std::ignore =
typename TestFixture::vector::const_iterator{} + 1,
"Precondition violation");
2617 ADLSwapSwapsContentsForBasicTypes,
2618 AfterClearVectorIsEmpty,
2619 AfterPushBackCanGetLastElement,
2620 AfterPushBackVectorIsNotEmpty,
2621 AssignFromInitListUsingAssignFunctionIsConditionallyNoexcept,
2622 AssignFromSizeAndValueIsConditionallyNoexcept,
2623 AtIndexSizeOrLargerThrows,
2624 AtIndexSizeOrLargerThrowsWithConstVec,
2625 AtOnConstVectorReturnsConstReference,
2628 BackReturnsReference,
2629 CanAccessMultipleValuesWithAt,
2630 CanAccessMultipleValuesWithAtWithConstVec,
2631 CanAccessMultipleValuesWithIndexOperator,
2632 CanAssignFromBiggerCapacityVector,
2633 CanAssignFromInitListUsingAssignFunction,
2634 CanAssignFromInputIteratorRange,
2635 CanAssignFromIteratorRange,
2636 CanAssignFromSizeAndValue,
2637 CanCompareForOrdering,
2638 CanConstructAnEmptyVector,
2639 CanConstructFromInitializerList,
2640 CanConstructFromIteratorRange,
2641 CanConstructWithSize,
2642 CanConstructWithSizeAndValue,
2643 CanConstructWithSizeViaTryConstruct,
2644 CanCopyViaConstruct,
2645 CanCopyViaConstructFromLargerWithFewerElements,
2646 CanCopyViaConstructFromSmaller,
2647 CanCopyViaTryConstruct,
2648 CanCopyViaTryConstructFromLargerWithFewerElements,
2649 CanCopyViaTryConstructFromSmaller,
2650 CanDefaultConstructViaTryConstruct,
2652 CanEraseAtBeginning,
2658 CanInsertAtEndOfExistingVector,
2659 CanInsertInEmptyVector,
2660 CanInsertInMiddleOfExistingVector,
2661 CanIterateOverConstValues,
2662 CanIterateOverValues,
2663 CanMoveViaConstruct,
2664 CanMoveViaTryConstruct,
2667 CanTryConstructFromInitializerList,
2668 CanTryConstructFromIteratorRange,
2669 CannotConstructWithSizeForANonDefaultConstructibleType,
2670 CannotTryConstructWithSizeForANonDefaultConstructibleType,
2671 CapacityIsAsSpecified,
2673 ConstBackReturnsConstReference,
2674 ConstructWithExcessiveSizeViaTryConstructFails,
2675 ConstructWithSizeViaNormalConstructWithDefaultConstructorNotNoexceptIsNotNoexcept,
2676 ConstructWithSizeViaTryConstructNotNoexceptIfDefaultConstructorNotNoexcept,
2677 CopyAssignOverLargerVectorDestroysExcess,
2678 CopyAssignOverLargerVectorFromInitListDestroysExcess,
2679 CopyAssignOverSmallerVectorCopiesElements,
2680 CopyAssignOverSmallerVectorFromInitListCopiesElements,
2681 CopyAssignmentIsConditionallyNoexcept,
2682 CopyingVectorCopiesElements,
2684 DefaultEmplaceIsConditionallyNoexcept,
2685 DefaultTryConstructNoexceptEvenIfDefaultConstructorNotNoexcept,
2686 EmplaceAtPositionIsConditionallyNoexcept,
2687 EmplaceBackIsConditionallyNoexcept,
2692 EraseIsNoexceptIfTypeHasNoexceptMove,
2693 FailToCopyViaTryConstructFromLargerWithMoreElements,
2694 FailToMoveViaTryConstructFromLargerWithMoreElements,
2695 IndexOperatorIsNoexcept,
2696 IndexOperatorOnConstVectorIsNoexcept,
2697 IndexOperatorOnConstVectorReturnsConstReference,
2698 IndexOperatorReturnsReference,
2700 InputIteratorRangeAssignmentIsConditionallyNoexcept,
2701 InputIteratorRangeConstructionIsConditionallyNoexcept,
2702 InputIteratorRangeTryConstructionIsConditionallyNoexcept,
2703 InsertFromIteratorRangeInMiddle,
2704 InsertFromIteratorRangeIsConditionallyNoexcept,
2705 InsertIsConditionallyNoexcept,
2706 InsertNAtEndInsertsElements,
2707 InsertNInMiddleInsertsElements,
2708 InsertWithCountIsConditionallyNoexcept,
2709 IteratorRangeAssignmentIsConditionallyNoexcept,
2710 IteratorRangeConstructionIsConditionallyNoexcept,
2711 IteratorRangeTryConstructionIsConditionallyNoexcept,
2713 MaxSizeEqualsCapacity,
2714 MoveAssignOverLargerVectorDestroysExcess,
2715 MoveAssignOverSmallerVectorMovesElements,
2716 MoveAssignmentIsConditionallyNoexcept,
2717 MovingVectorMovesElements,
2718 MovingVectorWithNewStorageMovesElements,
2719 NoStorageDataIsNull,
2720 NotConstructibleWithSizeAndSourceIfDataNotCopyable,
2721 NotCopyConstructible,
2722 NotCopyConstructibleIfDataTypeNotCopyConstructible,
2723 NotMoveConstructibleIfDataTypeNotMoveConstructible,
2725 PushBackIsConditionallyNoexcept,
2726 ResizeIsConditionallyNoexcept,
2727 ResizeWithValueIsConditionallyNoexcept,
2728 ResizingFromLargeToSmallLeavesElements,
2729 ResizingFromSmallToLargeConstructsElementsAsCopiesOfSpecified,
2730 RetrievingAValueWithAtReturnsValueAfterPushBack,
2731 RetrievingAValueWithAtThrowsOnEmpty,
2733 SecondPushBackChangesLastValue,
2736 StorageOnlyTryConstructNoexceptEvenIfDefaultConstructorNotNoexcept,
2737 SwapNoexceptMatchesElementType,
2738 TryConstructFromTooLargeInitializerListReturnsEmpty,
2740 ZeroSizeVectorIsEmpty
2745 AddingToInvalidIteratorIsPreconditionViolation,
2746 AssignIsPreconditionViolationIfSizeOverCapacity,
2747 ConstructWithExcessiveSizeViaNormalConstructIsAlwaysPreconditionViolation,
2748 ConstructingWithOutOfRangeSizeAndSourceIsPreconditionViolation,
2749 ConstructingWithOutOfRangeSizeIsPreconditionViolation,
2750 ConstructingWithTooManyInitializersIsPreconditionViolation,
2751 DereferencingInvalidIteratorIsPreconditionViolation,
2752 EmplaceBackIsPreconditionViolationIfFull,
2753 IndexOperatorOutOfRange,
2754 InsertNIsPreconditionViolationIfTooManyItems,
2755 InsertWhenAtCapacityIsPreconditionViolation,
2756 PushBackBeyondMaxSizeIsPreconditionViolation,
2757 PushBackOnZeroSizeVectorIsPreconditionViolation
Public export header for the byte subpackage.
A fixed-size array of T objects.
Definition array.hpp:77
detail::wrapped_iterator< const_pointer, array_detail::array_iter_passkey > const_iterator
An iterator for the array that treats the elements as const.
Definition array.hpp:107
a container similar to std::vector<T> that uses an external buffer for storage
Definition external_vector.hpp:359
Implementation of std::optional for pre-C++17 compilers, and which replaces defined undefined behavio...
Definition optional.hpp:122
A sum type which can hold either a value or an error. Similar to std::expected.
Definition result.hpp:104
ARENE_NODISCARD constexpr auto value() &noexcept -> value_type &
Accesses a reference to the content of the value channel.
Definition result.hpp:319
A backport of the constexpr std::reverse_iterator from C++17.
Definition reverse_iterator.hpp:188
A backport of std::span for C++14. Provides a view over a contiguous range of elements of type T.
Definition span.hpp:315
The Death Tests use the same fixture as the "normal" tests. Inherits so that it will be a distinct ty...
Definition external_vector.hpp:229
Test fixture for all type-parameterized external_vector tests.
Definition external_vector.hpp:73
storage_type< capacity > standard_storage_type
The type of the storage array for this type with the default capacity.
Definition external_vector.hpp:84
standard_storage_type standard_storage
An instance of the default storage type to use as backing for a default capacity vector.
Definition external_vector.hpp:88
input_iterator_with_configurable_noexcept< U, true > non_throwing_input_iterator
An input iterator pointing to any type which declares that it can not throw, used in some noexcept te...
Definition external_vector.hpp:173
static constexpr auto test_external_vector(arene::base::span< arene::base::byte > storage, std::size_t begin, std::size_t end) noexcept(std::is_nothrow_move_constructible< T >::value) -> vector
Return a vector containing the test values [begin,end) of T , parameterized by test suite users.
Definition external_vector.hpp:195
static constexpr auto test_external_vector(arene::base::span< arene::base::byte > storage, std::size_t size) noexcept(std::is_nothrow_move_constructible< T >::value) -> vector
Return a vector containing the test values [0,size) of T , parameterized by test suite users.
Definition external_vector.hpp:207
static constexpr auto test_value(std::size_t idx) noexcept(std::is_nothrow_move_constructible< T >::value) -> T
Return the idx 'th test value of the current T , parameterized by test suite users.
Definition external_vector.hpp:186
static constexpr auto test_external_vector(arene::base::span< arene::base::byte > storage) noexcept(std::is_nothrow_move_constructible< T >::value) -> vector
Return a vector containing the test values [0,capacity) of T , parameterized by test suite users.
Definition external_vector.hpp:216
static constexpr auto construct(U &&... params) noexcept(noexcept(vector(std::forward< U >(params)...))) -> vector
Construct a vector from the passed parameters; allows calling as this->construct, which can be shorte...
Definition external_vector.hpp:179
typedef try_construct_result
A helper template to get the type resulting from a try_construct call.
Definition external_vector.hpp:97
arene::base::array< arene::base::byte, Capacity *sizeof(T)> storage_type
The type of the storage array for this type with the specified capacity.
Definition external_vector.hpp:81
external_vector< T > vector
A standard vector with the correct type, used in most test cases.
Definition external_vector.hpp:91
static constexpr std::size_t capacity
The base capacity to use for most external_vector instantiations in the parameterized tests.
Definition external_vector.hpp:76
input_iterator_with_configurable_noexcept< U, false > throwing_input_iterator
An input iterator pointing to any type which declares that it could throw, used in some noexcept test...
Definition external_vector.hpp:169
An empty tag type corresponding to a bidirectional iterator.
Definition iterator_tags.hpp:25
Implementation of std::initializer_list for brace initialization.
Definition initializer_list.hpp:21
constexpr auto begin() const noexcept -> iterator
Get a pointer to the first element.
Definition initializer_list.hpp:46
static constexpr value_type value
Definition integral_constant.hpp:34
Type trait to detect if a type is constructible from arguments of the specified types.
Definition is_constructible.hpp:29
Type trait to detect if an instance of T is copy assignable.
Definition is_copy_assignable.hpp:59
Type trait to detect if an instance of T is copy constructible.
Definition is_copy_constructible.hpp:60
Type trait to detect if an instance of T is default constructible.
Definition is_default_constructible.hpp:26
Type trait to detect if an instance of T is move assignable.
Definition is_move_assignable.hpp:60
Type trait to detect if an instance of T is move constructible.
Definition is_move_constructible.hpp:59
Type trait to detect if an instance of To is assignable to from arguments of From without throwing.
Definition is_assignable.hpp:78
Type trait to detect if a type is constructible from arguments of the specified types and is noexcept...
Definition is_constructible.hpp:84
Type trait to detect if an instance of T is copy assignable without throwing.
Definition is_copy_assignable.hpp:69
Type trait to detect if an instance of T is copy constructible without throwing.
Definition is_copy_constructible.hpp:71
Type trait to detect if an instance of T is default constructible without throwing.
Definition is_default_constructible.hpp:36
Type trait to detect if an instance of T is move assignable without throwing.
Definition is_move_assignable.hpp:70
Type trait to detect if an instance of T is move constructible without throwing.
Definition is_move_constructible.hpp:70
Trait to detect if the two template parameters are the same or not. The value member is true if the t...
Definition is_same.hpp:35
provides a uniform interface to the properties of an iterator
Definition iterator_traits.hpp:90
static constexpr auto max() noexcept -> T
The maximum finite value.
Definition numeric_limits.hpp:230
An empty tag type corresponding to a random access iterator.
Definition iterator_tags.hpp:29
Provides macros used to disable and enable compiler specific diagnostics using the _Pragma operator.
#define ARENE_IGNORE_END()
Ends a region of a suppressed diagnostic.
Definition diagnostics.hpp:136
#define ARENE_IGNORE_START()
Begins a region of a suppressed diagnostic.
Definition diagnostics.hpp:131
#define ARENE_IGNORE_ALL(s, comment)
Pushes an ignore for a diagnostic into the compiler for any compiler.
Definition diagnostics.hpp:122
static ARENE_MAYBE_UNUSED constexpr auto const & swap
A Customization Point Object implementation of the constexpr compatible std::swap from C++17.
Definition swap.hpp:130
Definition customization.hpp:31
constexpr auto constexpr_resize(Vec vec, std::size_t size) -> Vec
Definition external_vector.hpp:1068
constexpr auto constexpr_iterate(Args &&... args) -> bool
Definition external_vector.hpp:663
constexpr auto bubble_sort_helper(Container container) noexcept -> Container
Inefficiently bubble sorts the argument because std::sort is not constexpr in C++14.
Definition external_vector.hpp:1614
constexpr auto test_external_vector(arene::base::span< arene::base::byte > storage, std::size_t begin, std::size_t end) noexcept(std::is_nothrow_copy_constructible< T >::value) -> ::arene::base::external_vector< T >
Create a test external vector containing a range of test values.
Definition external_vector.hpp:51
constexpr auto test_value(std::size_t idx) noexcept(noexcept(customization_detail::test_value_generator< T >::test_value(idx))) -> T
Get the idx 'th test value of type T.
Definition customization.hpp:108
constexpr auto contains_duplicates(Container const &container) noexcept -> bool
Checks whether or not the given container has any duplicates, which we need to assert for test logic.
Definition external_vector.hpp:1596
TYPED_TEST_SUITE_P(ExternalVectorTest)
TYPED_TEST_P(ExternalVectorTest, CanConstructAnEmptyVector)
Definition external_vector.hpp:236
REGISTER_TYPED_TEST_SUITE_P(ExternalVectorTest, ADLSwapSwapsContentsForBasicTypes, AfterClearVectorIsEmpty, AfterPushBackCanGetLastElement, AfterPushBackVectorIsNotEmpty, AssignFromInitListUsingAssignFunctionIsConditionallyNoexcept, AssignFromSizeAndValueIsConditionallyNoexcept, AtIndexSizeOrLargerThrows, AtIndexSizeOrLargerThrowsWithConstVec, AtOnConstVectorReturnsConstReference, AtReturnsReference, BackIsNoexcept, BackReturnsReference, CanAccessMultipleValuesWithAt, CanAccessMultipleValuesWithAtWithConstVec, CanAccessMultipleValuesWithIndexOperator, CanAssignFromBiggerCapacityVector, CanAssignFromInitListUsingAssignFunction, CanAssignFromInputIteratorRange, CanAssignFromIteratorRange, CanAssignFromSizeAndValue, CanCompareForOrdering, CanConstructAnEmptyVector, CanConstructFromInitializerList, CanConstructFromIteratorRange, CanConstructWithSize, CanConstructWithSizeAndValue, CanConstructWithSizeViaTryConstruct, CanCopyViaConstruct, CanCopyViaConstructFromLargerWithFewerElements, CanCopyViaConstructFromSmaller, CanCopyViaTryConstruct, CanCopyViaTryConstructFromLargerWithFewerElements, CanCopyViaTryConstructFromSmaller, CanDefaultConstructViaTryConstruct, CanEmplaceBack, CanEraseAtBeginning, CanEraseInMiddle, CanEraseRange, CanGetCBeginAndEnd, CanGetFront, CanGetIterator, CanInsertAtEndOfExistingVector, CanInsertInEmptyVector, CanInsertInMiddleOfExistingVector, CanIterateOverConstValues, CanIterateOverValues, CanMoveViaConstruct, CanMoveViaTryConstruct, CanPopBack, CanPushBackAValue, CanTryConstructFromInitializerList, CanTryConstructFromIteratorRange, CannotConstructWithSizeForANonDefaultConstructibleType, CannotTryConstructWithSizeForANonDefaultConstructibleType, CapacityIsAsSpecified, CapacityIsNoexcept, ConstBackReturnsConstReference, ConstructWithExcessiveSizeViaTryConstructFails, ConstructWithSizeViaNormalConstructWithDefaultConstructorNotNoexceptIsNotNoexcept, ConstructWithSizeViaTryConstructNotNoexceptIfDefaultConstructorNotNoexcept, CopyAssignOverLargerVectorDestroysExcess, CopyAssignOverLargerVectorFromInitListDestroysExcess, CopyAssignOverSmallerVectorCopiesElements, CopyAssignOverSmallerVectorFromInitListCopiesElements, CopyAssignmentIsConditionallyNoexcept, CopyingVectorCopiesElements, Data, DefaultEmplaceIsConditionallyNoexcept, DefaultTryConstructNoexceptEvenIfDefaultConstructorNotNoexcept, EmplaceAtPositionIsConditionallyNoexcept, EmplaceBackIsConditionallyNoexcept, EmplaceInsert, EmptyIfJustStorage, EmptyIsNoexcept, EmptybyDefault, EraseIsNoexceptIfTypeHasNoexceptMove, FailToCopyViaTryConstructFromLargerWithMoreElements, FailToMoveViaTryConstructFromLargerWithMoreElements, IndexOperatorIsNoexcept, IndexOperatorOnConstVectorIsNoexcept, IndexOperatorOnConstVectorReturnsConstReference, IndexOperatorReturnsReference, InitialSizeIsZero, InputIteratorRangeAssignmentIsConditionallyNoexcept, InputIteratorRangeConstructionIsConditionallyNoexcept, InputIteratorRangeTryConstructionIsConditionallyNoexcept, InsertFromIteratorRangeInMiddle, InsertFromIteratorRangeIsConditionallyNoexcept, InsertIsConditionallyNoexcept, InsertNAtEndInsertsElements, InsertNInMiddleInsertsElements, InsertWithCountIsConditionallyNoexcept, IteratorRangeAssignmentIsConditionallyNoexcept, IteratorRangeConstructionIsConditionallyNoexcept, IteratorRangeTryConstructionIsConditionallyNoexcept, IteratorTypedefs, MaxSizeEqualsCapacity, MoveAssignOverLargerVectorDestroysExcess, MoveAssignOverSmallerVectorMovesElements, MoveAssignmentIsConditionallyNoexcept, MovingVectorMovesElements, MovingVectorWithNewStorageMovesElements, NoStorageDataIsNull, NotConstructibleWithSizeAndSourceIfDataNotCopyable, NotCopyConstructible, NotCopyConstructibleIfDataTypeNotCopyConstructible, NotMoveConstructibleIfDataTypeNotMoveConstructible, PopBackIsNoexcept, PushBackIsConditionallyNoexcept, ResizeIsConditionallyNoexcept, ResizeWithValueIsConditionallyNoexcept, ResizingFromLargeToSmallLeavesElements, ResizingFromSmallToLargeConstructsElementsAsCopiesOfSpecified, RetrievingAValueWithAtReturnsValueAfterPushBack, RetrievingAValueWithAtThrowsOnEmpty, ReverseIteration, SecondPushBackChangesLastValue, SizeIsCorrect, SizeIsNoexcept, StorageOnlyTryConstructNoexceptEvenIfDefaultConstructorNotNoexcept, SwapNoexceptMatchesElementType, TryConstructFromTooLargeInitializerListReturnsEmpty, Typedefs, ZeroSizeVectorIsEmpty)
MATCHER_P(elements_match_function, function, "")
Definition external_vector.hpp:936
constexpr bool is_fully_comparable_v
Definition external_vector.hpp:1634
Definition accumulate.hpp:37
constexpr bool is_nothrow_swappable_v
Trait query indicating if a type can be noexcept-swapped.
constexpr std::integral_constant< std::size_t, N > array< T, N >::size
Definition array.hpp:534
constexpr std::integral_constant< bool, false > array< T, N >::empty
Definition array.hpp:540
constexpr std::integral_constant< std::size_t, N > array< T, N >::max_size
Definition array.hpp:537
constexpr bool is_greater_than_or_equal_comparable_v
constexpr bool substitution_succeeds
Determines if a template can be instantiated successfully, similar to C++20's requires clause.
constexpr auto copy(InputIterator first, InputIterator last, OutputIterator output) noexcept(noexcept(*(++output)) &&noexcept(*(++first)) &&noexcept(first !=last) &&std::is_nothrow_assignable<, typename std::iterator_traits< InputIterator >::reference >::value) -> OutputIterator
Copies the elements in the range, defined by [first, last), to another range beginning at output.
Definition copy.hpp:40
constexpr bool is_less_than_comparable_v
constexpr bool is_less_than_or_equal_comparable_v
enum ARENE_MAY_ALIAS byte
A type that represents a byte of data.
Definition byte.hpp:39
constexpr bool is_greater_than_comparable_v
Definition accumulate.hpp:36
typedef nullptr_t
The type of nullptr.
Definition cstddef.hpp:33
::ptrdiff_t ptrdiff_t
A type suitable for holding the difference between two pointers.
Definition cstddef.hpp:31
constexpr auto move(T &&value) noexcept -> remove_reference_t< T > &&
Cast a value to an rvalue.
Definition move.hpp:30
::size_t size_t
A type suitable for holding the size of an object.
Definition cstddef.hpp:29
auto declval() noexcept -> T &&
A dummy function that is declared but not defined, with a user-specified return type,...
static constexpr auto const & ignore
An object to which anything can be assigned, which ignores the assigned value.
Definition ignore.hpp:72
constexpr auto addressof(T &value) noexcept -> T *
Obtains the actual address of the object or function arg, even in presence of overloaded operator&.
Definition addressof.hpp:24
constexpr auto forward(remove_reference_t< T > &value) noexcept -> T &&
Cast a value to an rvalue if T is an rvalue or rvalue reference, otherwise forward an lvalue referenc...
Definition forward.hpp:24
Public export header for span.hpp.
A bidirectional iterator of T which declares that it could throw, used in some noexcept tests.
Definition external_vector.hpp:108
std::ptrdiff_t difference_type
The type used for differences in this iterator.
Definition external_vector.hpp:112
std::bidirectional_iterator_tag iterator_category
The category of this iterator.
Definition external_vector.hpp:110
T value_type
The value type pointed to by this iterator.
Definition external_vector.hpp:116
auto operator!=(throwing_bidirectional_iterator_of_t const &) -> bool
Inequality operator; never defined.
auto operator--() -> throwing_bidirectional_iterator_of_t &
Pre-decrement operator; never defined.
auto operator++(int) -> throwing_bidirectional_iterator_of_t
Post-increment operator; never defined.
T & reference
The type returned by dereferencing this iterator.
Definition external_vector.hpp:114
auto operator--(int) -> throwing_bidirectional_iterator_of_t
Post-decrement operator; never defined.
auto operator==(throwing_bidirectional_iterator_of_t const &) -> bool
Equality operator; never defined.
auto operator*() -> reference
Dereference operator; never defined.
void pointer
This iterator as a pointer (disabled)
Definition external_vector.hpp:118
auto operator++() -> throwing_bidirectional_iterator_of_t &
Pre-increment operator; never defined.
A type with a noexcept(false) conversion operator to T (doesn't actually throw, just declares it)
Definition external_vector.hpp:100
Definition external_vector.hpp:1707
throws_without_nullptr(T)
Definition external_vector.hpp:1708
throws_without_nullptr(T, std::nullptr_t) noexcept
Definition external_vector.hpp:1709
#define CONDITIONAL_TYPED_TEST_P(SuiteName, TestName,...)
Adds a type-parameterized test to a Google Test suite which is conditionally run based on the third p...
Definition conditional_tests.hpp:33