Example of the perils of binding rvalues to const ref

IgorStepanov via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 18 04:14:04 PDT 2014


On Thursday, 18 September 2014 at 10:50:31 UTC, monarch_dodra 
wrote:
> On Thursday, 18 September 2014 at 00:53:40 UTC, Andrei 
> Alexandrescu wrote:
>> On 9/17/14, 12:28 PM, IgorStepanov wrote:
>>> I want to place Foo(1) to buckets[nn].key without postblit 
>>> call.
>>> Compiler can't help me now, however, I think, It can do it 
>>> without
>>> language change.
>>
>> File an enhancement request with explanations and sample code, 
>> the works. This will be good. Thanks! -- Andrei
>
> I think it's this one:
> https://issues.dlang.org/show_bug.cgi?id=12684
>
> Kind of required when you requested emplace from rvalues:
> https://issues.dlang.org/show_bug.cgi?id=12628

Yes, your 12684 issue is a case of new 13492.
I've tried to classify the problem and describe a danger cases.


More information about the Digitalmars-d mailing list