blob: 3b269f5dff5032a37270b1b7b946f80ba07fbe8a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <vector>
#include <ranges>
#include <string>
#include <span>
#include <algorithm>
#include <iostream>
main: () -> int = {
vec: std::vector<std::string>
= ("hello", "2022");
y := "\n";
std::ranges::for_each
( vec, :(x) = std::cout << x << y$ );
callback := :(inout x) = x += "-ish";
std::ranges::for_each( vec, callback );
for vec do (str)
std::cout << str << "\n";
}
|