kblib 0.2.3
General utilities library for modern C++
multi_span.cpp
Go to the documentation of this file.
1#if KBLIB_USE_CXX17
2
3# include "kblib/multi_span.h"
4# include "catch.hpp"
5
6# include <array>
7# include <sstream>
8
9TEST_CASE("multi_span") {
10 std::array<std::array<int, 10>, 10> arrs{};
11 kblib::multi_span<int> span{arrs.begin(), arrs.end()};
12 REQUIRE(std::distance(span.begin(), span.end()) == 10 * 10);
13}
14
15# if 0
16TEST_CASE("input iterators") {
17 std::istringstream i1("0 1 2 3 4 5 6 7 8 9");
18 std::istringstream i2("9 8 7 6 5 4 3 2 1 0");
20 {std::istream_iterator<int>(i1), std::istream_iterator<int>()},
21 {std::istream_iterator<int>(i2), std::istream_iterator<int>()}};
22}
23# endif
24
25#endif
auto begin() noexcept -> iterator
Definition: multi_span.h:251
TEST_CASE("multi_span")
Definition: multi_span.cpp:9
Provides multi_span.