pass-by-ref semantics for structs (was Deque impl.)

Dmitry Olshansky dmitry.olsh at gmail.com
Thu Jan 31 12:08:14 PST 2013


31-Jan-2013 23:51, Maxim Fomin пишет:
> On Thursday, 31 January 2013 at 19:34:29 UTC, Dmitry Olshansky wrote:
>> This is fine except that it doesn't solve the problem of:
>> Container a = Container(); //should be empty container, not illegal
>> null-container
>>
>> Basically @dsiable this() is optional, but I like to help user avoid
>> bugs.
>
> You have static opCall for such things. Since when this was a problem?

Yes, that's why I use it still...

it can't initialize a const struct *and* requires a T.init or T a = 
void; or forward to this(int dummy=42) container.


-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list