Example of the perils of binding rvalues to const ref

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 17 07:54:19 PDT 2014


On 9/17/14, 2:01 AM, Szymon Gatner wrote:
> std::string returned from get_url() is a temporary and hence a "rvalue".
> In fact it's address cannot be taken.

It can in C++, after bound (implicitly!) to a const &. "That was the 
joke." That's why I'm opposed to adding the same conversion to D without 
restriction. -- Andrei


More information about the Digitalmars-d mailing list