Generality creep

Olivier FAURE couteaubleu at gmail.com
Wed Mar 20 11:01:06 UTC 2019


On Tuesday, 19 March 2019 at 02:52:34 UTC, Andrei Alexandrescu 
wrote:
> The change that does make the code work is:
>
>     struct TestAliasedString
>     {
>         ref string get() @safe @nogc pure nothrow { return _s; }
>         ref const(string) get() @safe @nogc pure nothrow const 
> { return _s; }
>         alias get this;
>         @disable this(this);
>         string _s;
>     }
>

Isn't this exactly the kind of code where you're supposed to use 
inout?


More information about the Digitalmars-d mailing list