tgen
Loading...
Searching...
No Matches

Printer helper for standard types, printing on a new line. More...

Inheritance diagram for tgen::println:

Public Member Functions

template<typename T>
 println (const T &val, char sep=' ')
 Cretes a printer object that prints on a new line.
Public Member Functions inherited from tgen::print
template<typename T>
 print (const T &val, char sep=' ')
 Cretes a printer object.

Friends

std::ostream & operator<< (std::ostream &out, const println &pr)
 Prints printer object on a new line.

Detailed Description

Printer helper for standard types, printing on a new line.

Same as print, but prints on a new line (appending a
at the end).

Examples

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

Definition at line 506 of file tgen.h.

Constructor & Destructor Documentation

◆ println()

template<typename T>
tgen::println::println ( const T & val,
char sep = ' ' )
inline

Cretes a printer object that prints on a new line.

Parameters
valValue to be printed.
sepSeparator for values printed in the same line.

Definition at line 508 of file tgen.h.

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const println & pr )
friend

Prints printer object on a new line.

Parameters
outStream to print to.
prPrinter object.

Definition at line 517 of file tgen.h.


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