properly passing strings to functions? (C++ vs D)
Ali Çehreli
acehreli at yahoo.com
Mon Jan 11 16:40:53 UTC 2021
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
More information about the Digitalmars-d-learn
mailing list