tgen
Loading...
Searching...
No Matches
tgen::print Struct Reference

Printer helper for standard types. More...

Detailed Description

Printer helper for standard types.

Just call std::cout << print(x) to print x, or std::cout << println(x) to print x and \n. Works with std::initializer_list.

Prints std::pair, std::tuple and containers nicely (separade by a space). Matrices (container<container<T>>) are also handleled nicely, printing one row per line.

Examples

std::tuple<int, double, std::string> tu = {5, 0.1, "str"};
std::cout << println(tu);
// "5 0.1 str\n"
std::cout << print({{1, 2}, {3, 4}});
// "1 2\n3 4"
Printer helper for standard types.
Definition tgen.h:149

Definition at line 149 of file tgen.h.


The documentation for this struct was generated from the following file:
  • /home/runner/work/tgen/tgen/single_include/tgen.h