C++ Library Extensions 2022.12.09
To help learn modern C++ programming
054-iterator.cpp
Go to the documentation of this file.
1#include <tpf_output.hpp>
2
5
7{
8 int array[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
9
10 for(auto& e: tpf::reverse(array))
11 {
12 ++e;
13 stream << e << ", ";
14 }
15
16 stream << endl;
17
18 for(auto& e: array)
19 {
20 stream << e << ", ";
21 }
22
23 auto clone = tpf::reverse(array).clone();
24
25 stream << clone << endl;
26}
27
29{
30 for(auto e: tpf::reverse(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))
31 {
32 std::cout << e << ", ";
33 }
34}
35
36int main()
37{
38
40
41 // test_reverse_rvalue_iterator();
42}
auto & cout
tpf::sstream stream
Definition: 054-iterator.cpp:3
auto endl
Definition: 054-iterator.cpp:4
void test_reverse_rvalue_iterator()
void test_reverse_iterator()
Definition: 054-iterator.cpp:6
int main()
decltype(auto) reverse(ContainerType &&container)
Definition: tpf_types.hpp:7959
constexpr auto endl
Definition: tpf_output.hpp:973
Stream output operators << are implemented.