std.algorithm move() struct emptying

Torarin torarind at gmail.com
Mon Aug 30 13:27:04 PDT 2010


Yeah, I get the enum case, but what I forgot to mention is that the
example from move() is enclosed in
static if (is(T == struct))

Which makes me wonder what kind of struct would have an rvalue .init.

Torarin

2010/8/30 Stanislav Blinov <stanislav.blinov at gmail.com>:

> You may be able to take address of what .init returns, but what Andrei meant
> by 'it is not guaranteed' means that this is not always the case. So
> basically, you should not rely on the cases when you can do that.
>
> That's why I was wrong, also. The case wasn't about temporaries at all :)
>


More information about the Digitalmars-d mailing list