The following code example is taken from the book
C++23 - The Complete Guide
by Nicolai M. Josuttis,
Leanpub, 2026
The code is licensed under a
Creative Commons Attribution 4.0 International License.
// raw code
#include <print>
#include <vector>
#include <set>
#include "processview0.hpp"
int main()
{
std::vector vec{0, 8, 15, 11};
std::println("{}", vec);
std::println("{}", ProcessView{vec});
std::println("{}", ProcessView{vec} | std::views::drop(1));
std::println("{}", ProcessView{std::set{"tic", "tac", "toe"}});
// not supported yet:
#ifdef NOTSUPPORTED
std::println("{}", vec | ProcessView);
std::println("{}", vec | ProcessView{});
std::println("{}", vec | process);
std::println("{}", std::set{"tic", "tac", "toe"} | process);
#endif
}