14 std::array x{ 1, 2, 3, 4, 5 }, y{ 6, 7, 8, 9, 10 };
17 auto println = [](
const auto &arg,
const std::string &sep,
const std::string &lend) {
19 for (
size_t idx = 1; idx < arg.size(); idx++) {
20 std::cout << sep << arg[idx];
24 println(x,
", ",
"\n");
25 println(y,
" &",
"\\\\\n");
32 Format fmt1{
"fmt1",
",\t",
"\n",
"dat" },
33 fmt2{
"fmt2",
"&\t",
"\\\\\n",
"dat" };
34 std::array x{ 1, 2, 3, 4, 5 }, y{ 6, 7, 8, 9, 10 };
36 fmt1.write_line(std::cout, x);
37 fmt2.write_line(std::cout, y);
44 Format fmt{
"fmt1",
"\t",
"\n",
"dat" };
45 std::array x{ 1, 2, 3, 4, 5 }, y{ 6, 7, 8, 9, 10 };
47 fmt.as_rows(std::cout, x, y);
54 Format fmt{
"fmt1",
",\t",
"\n",
"csv" };
55 std::array x{ 1, 2, 3, 4, 5 },
57 z{ 11, 12, 13, 14, 15 };
59 fmt.as_columns(std::cout, x, y, z);
66 Format fmt{
"fmt1",
",\t",
"\n",
"csv" };
67 std::vector<std::vector<double>> table{ { 1, 2, 3, 4, 5 },
69 { 11, 12, 13, 14, 15 } };
71 fmt.as_columns(std::cout, table);
void ex1()
ex1 Beispiel für die formatierte Ausgabe von Arrays
void ex5()
ex5 Beispiel für die formatierte Ausgabe eines Arrays
void ex4()
ex4 Beispiel für die formatierte Ausgabe eines Arrays
void ex2()
ex2 Beispiel für die formatierte Ausgabe eines Arrays
void ex3()
ex3 Beispiel für die formatierte Ausgabe eines Arrays