init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
54
Telegram/ThirdParty/range-v3/test/view/all.cpp
vendored
Normal file
54
Telegram/ThirdParty/range-v3/test/view/all.cpp
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
// Range v3 library
|
||||
//
|
||||
// Copyright Eric Niebler 2014-present
|
||||
//
|
||||
// Use, modification and distribution is subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// Project home: https://github.com/ericniebler/range-v3
|
||||
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include <range/v3/core.hpp>
|
||||
#include <range/v3/view/all.hpp>
|
||||
#include "../simple_test.hpp"
|
||||
#include "../test_utils.hpp"
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace ranges;
|
||||
|
||||
int rgi[] = {1, 1, 1, 2, 3, 4, 4};
|
||||
std::vector<int> vi(begin(rgi), end(rgi));
|
||||
std::list<int> li(begin(rgi), end(rgi));
|
||||
|
||||
ref_view<int[7]> x = views::all(rgi);
|
||||
ref_view<std::vector<int>> y = views::all(vi);
|
||||
ref_view<std::list<int>> z = views::all(li);
|
||||
|
||||
CPP_assert(sized_range<decltype(x)> && view_<decltype(x)>);
|
||||
CPP_assert(sized_range<decltype(y)> && view_<decltype(y)>);
|
||||
CPP_assert(sized_range<decltype(z)> && view_<decltype(z)>);
|
||||
|
||||
x = views::all(x);
|
||||
y = views::all(y);
|
||||
z = views::all(z);
|
||||
|
||||
CHECK(x.size() == 7u);
|
||||
CHECK(y.size() == 7u);
|
||||
CHECK(z.size() == 7u);
|
||||
|
||||
{
|
||||
auto v = views::all(debug_input_view<int const>{rgi});
|
||||
CHECK(v.size() == size(rgi));
|
||||
CHECK(v.data_->first_ == rgi);
|
||||
auto v2 = views::all(views::all(views::all(std::move(v))));
|
||||
CPP_assert(same_as<decltype(v), decltype(v2)>);
|
||||
CHECK(v2.size() == size(rgi));
|
||||
CHECK(v2.data_->first_ == rgi);
|
||||
}
|
||||
|
||||
return test_result();
|
||||
}
|
||||
Reference in New Issue
Block a user