std.algorithm move() struct emptying

Torarin torarind at gmail.com
Sun Aug 29 11:51:51 PDT 2010


Even in this case, or in some special case?

Torarin

2010/8/29 Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org>:
> On 08/29/2010 12:00 PM, Torarin wrote:
>>
>> Hi,
>> in std.algorithm move(), this is the operation used to set the source of
>> a struct move to .init:
>>
>>   static T empty;
>>   memcpy(&source, &empty, T.sizeof);
>>
>> Is there any particular reason why the more compact &T.init is not used?
>
> T.init is not guaranteed to be an lvalue.
>
> Andrei
>


More information about the Digitalmars-d mailing list