37 std::vector<int> v123 = {1, 2, 3};
38 std::vector<int> v45 = {4, 5};
40 SECTION(
"non-empty + non-empty") {
42 CHECK(v123 == std::vector<int>{1, 2, 3, 4, 5});
44 SECTION(
"non-empty + empty") {
46 CHECK(v123 == std::vector<int>{1, 2, 3});
48 SECTION(
"empty + non-empty") {
50 CHECK(v == std::vector<int>{4, 5});
52 SECTION(
"empty + empty") {
54 CHECK(v == std::vector<int>{});
56 SECTION(
"non-empty + view") {
58 CHECK(v45 == std::vector<int>{4, 5, 2, 3});
60 SECTION(
"empty + l-value") {
64 std::vector<S> v2 = {
S(),
S()};
89 SECTION(
"empty + r-value") {
93 std::vector<S> v2 = {
S(),
S()};
102 append(v1, std::move(v2));
123 SECTION(
"deduce type") {
124 std::list<int> l = {1, 2, 3};
126 CHECK(v.size() == 3);
130 CHECK(std::is_same_v<
decltype(v)::value_type,
int>);
132 SECTION(
"convert type") {
133 std::list<int> l = {1, 2, 3};
134 auto v = to_vector<char>(l);
135 CHECK(v.size() == 3);
139 CHECK(std::is_same_v<
decltype(v)::value_type,
char>);
145 std::vector<int> v1 = {1, 2, 3};
146 SECTION(
"deduce type") {
148 CHECK(v.size() == 1);
150 CHECK(std::is_same_v<
decltype(v)::value_type,
int>);
152 SECTION(
"convert type") {
153 auto v = to_vector<long long>(
view::drop(v1, 1));
154 CHECK(v.size() == 2);
157 CHECK(std::is_same_v<
decltype(v)::value_type,
long long>);
167 std::vector<S> v1 = {
S(),
S(),
S()};
195 std::vector<S> v1 = {
S(),
S(),
S()};
225std::vector<int> check1(
const std::vector<int>& v)
229std::vector<int> check2(
const std::vector<int>& v)
231 return std::vector<int>(
begin(v) + 1,
end(v));
constexpr auto drop(Range &&range, size_t n)
auto to_vector(Range &&range) -> std::vector< detail::ToVectorType< T, decltype(std::begin(range))> >
void append(std::vector< T > &v, Tail &&... tail)
static int move_assignment
static int move_constructed
static int copy_assignment
static int default_constructed
static int copy_constructed
S & operator=(S &&) noexcept
constexpr auto begin(const zstring_view &x)
constexpr auto end(const zstring_view &x)