opCmp with structs

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Nov 7 07:59:15 PST 2015


On 07.11.2015 15:36, Mike Parker wrote:
> It's actually possible to use move one instance
> into another, though:
>
> void main() {
>      import std.algorithm : move;
>      ku k1 = ku(1);
>      ku k2 = ku(2);
>      k2.move(k1);
>      assert(k1.id == 2);
> }

Wat. It even compiles with @safe. That's not good.


More information about the Digitalmars-d-learn mailing list