On 1/11/21 8:22 AM, zack wrote:
On Monday, 11 January 2021 at 15:25:58 UTC, Ola Fosheim Grøstad wrote:I meant allocation... The following prints "1", so no allocation.Just tried on Windows with Visual Studio, it prints "0". So I guess this is platform/compiler dependent.
Yes. Earlier C++ string implementations used reference counting, which caused multi-threading complications; so, many implementations switched to copying.
Ali