Line data Source code
1 : #pragma once
2 :
3 : #include <ranges>
4 :
5 : namespace views {
6 : using namespace std::views;
7 :
8 9 : auto constexpr toString = transform([](auto const &x) { return std::to_string(x); });
9 :
10 6760 : auto constexpr splitLines = std::views::split('\n') | transform([](auto &&r) {
11 6760 : return std::string_view(r.begin(), r.end());
12 6760 : });
13 :
14 1 : constexpr auto toStringAndJoinWith(std::string_view const j) { return toString | join_with(j); }
15 0 : constexpr auto toStringAndJoinWith(char const j) { return toString | join_with(j); }
16 :
17 : } // namespace views
|