Boost logo

Boost :

Subject: Re: [boost] Variadic append for std::string
From: Christof Donat (cd_at_[hidden])
Date: 2017-01-13 10:30:09


Am 12.01.2017 20:05, schrieb Olaf van der Spek:
> On Wed, Jan 11, 2017 at 5:45 PM, Christof Donat <cd_at_[hidden]> wrote:
>> Basically the Idea of that kind of interface should work as well for a
>> high performance solution. Let's start with this syntax:
>> auto myString = (cat() + "Hello"s + " "s + "World! "s + 42).str();
> I like fmt's syntax much more:
> string s = fmt::format("The answer is {}", 42);
> I really don't get why we should bother with the (cat(...)).str() bit.

Format will have to parse the format string at runtime and then chose
dynamically the function to stringify the number. The cat() aproach can
be implemented to do that choice at compiletime. So no string parsing
and not dynamic choice of formating functions. We were talking about
performance in this chapter, weren't we?


Boost list run by bdawes at, gregod at, cpdaniel at, john at