A simplification of the RvalueRef idiom

Nordlöw via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Nov 22 05:06:27 PST 2016


On Monday, 21 November 2016 at 20:04:51 UTC, Ali Çehreli wrote:
> mixin template RvalueRef()    // <-- DOES NOT TAKE A PARAMETER 
> ANY MORE
> {
>     alias T = typeof(this);
>     static assert (is(T == struct));
>
>     @nogc @safe
>     ref const(T) byRef() const pure nothrow return

Why do you need to qualify `byRef` as pure nothrow when it's a 
template?


More information about the Digitalmars-d-learn mailing list