std.algorithm move() struct emptying

Philippe Sigaud philippe.sigaud at gmail.com
Tue Aug 31 09:28:35 PDT 2010


On Tue, Aug 31, 2010 at 17:05, Andrei Alexandrescu <
SeeWebsiteForEmail at erdani.org> wrote:

> On 8/31/10 7:49 CDT, Michel Fortin wrote:
>
>> On 2010-08-31 06:16:17 -0400, bearophile <bearophileHUGS at lycos.com> said:
>>
>>  If in generic code T.init is not guaranteed to be an lvalue, as your
>>> example shows, isn't it better to disallow (turning it into a syntax
>>> error) &T.init in all cases?
>>>
>>
>> Personally, I'd say the code should check if T.init is an lvalue using
>> __traits(compiles, &T.init) or is(typeof(&T.init)) and avoid creating a
>> static variable or temporary when it is. This optimization of course
>> depends &T.init not being a syntax error.
>>
>
> I recall I wrote that code to avoid a compiler bug when T == Tuple!(some
> types).
>
> Andrei
>

Is that related to this bug?
http://d.puremagic.com/issues/show_bug.cgi?id=4536


Philippe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20100831/013f11be/attachment.html>


More information about the Digitalmars-d mailing list