We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a073f6 commit c572915Copy full SHA for c572915
examples/repeat.cpp
@@ -2,19 +2,20 @@
2
#include <iostream>
3
4
int main() {
5
+ // Example usage of lz::repeat, yields elements by value
6
const auto to_repeat = 155;
7
const auto amount = 4;
8
const auto repeater_n = lz::repeat(to_repeat, amount);
9
const auto repeater_inf = lz::repeat(to_repeat);
10
11
#ifdef LZ_HAS_CXX_17
- for (int& i : repeater_n) {
12
+ for (int i : repeater_n) {
13
std::cout << i << ' ';
14
// Or use fmt::print("{} ", i);
15
}
16
// Output: 155 155 155 155
17
- for (const auto& i : repeater_inf) {
18
+ for (const auto i : repeater_inf) {
19
20
21
0 commit comments