Example of the perils of binding rvalues to const ref

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 16 17:02:52 PDT 2014


On 9/16/14, 11:26 AM, monarch_dodra wrote:
> Arguably, the issue is not const ref binding to an rvalue itself, but
> rather taking (and *holding*) the address of a parameter that is passed
> by const ref

It doesn't do that. It holds pointer/length to the slice, which is 
different and distinct from the pointer to the string. -- Andrei


More information about the Digitalmars-d mailing list