Pretty output formatting in C++11
January 19, 2017 · 1 minute to read · C++, C++11
Let’s use a new C++11 feature: user-defined literal.
Thanks to this one, you could now declare new type from a string or a number. For example
"2012-10-30"_date can create a new Date object with these information.
But we could use this feature to other useful things, like format a nice output.
Here, some examples:
Output looks like: