13 Jan
2017
13 Jan
'17
4:29 p.m.
Christof Donat wrote:
Am 12.01.2017 20:05, schrieb Olaf van der Spek:
I like fmt's syntax much more:
string s = fmt::format("The answer is {}", 42);
fmtlib looks pretty cool. In fact it's basically a superset of my private library. Some of the design decisions aren't the same but the overall style is very similar.
Format will have to parse the format string at runtime and then chose dynamically the function to stringify the number.
It does, of course, parse the format string, but I'm not sure what you mean by "choose function dynamically." The above basically does something like os << "The answer is "; os << 42; return os.str(); using one virtual call for the os << 42 part.