C++ Library Extensions 2022.12.09
To help learn modern C++ programming
058-array_wrapper.cpp
Go to the documentation of this file.
1#include <tpf_output.hpp>
2
5auto nl = tpf::nl;
6
7namespace types = tpf::types;
8
10{
11 int array[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
12 double darray[] {0.0, 1.0, 1.3};
13
14 tpf::types::array_wrapper_t wapper{array};
15
16 auto& [pointer, size] = wapper;
17
18 stream << wapper << endl;
19
21
23
24 auto msg1 = "I love it";
25 auto& msg2 = "What?";
26 auto v = tpf::make_vector(array);
27
28 stream << v << endl;
29
31}
32
33int main()
34{
36}
void test_array_wrapper()
tpf::sstream stream
auto endl
auto nl
int main()
Type to string name conversions are defined.
Definition: 31-visit.cpp:7
auto array_wrapper(ElementType(&array)[ElementSize]) noexcept
Definition: tpf_types.hpp:1228
decltype(auto) make_vector(Type &&arg, Types &&... args)
Definition: tpf_types.hpp:7911
constexpr auto endl
Definition: tpf_output.hpp:973
constexpr auto nl
Definition: tpf_output.hpp:971
Stream output operators << are implemented.