Are contracts intended for verifying @safety;

Somebody via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Nov 7 09:30:09 PST 2016


void moveFrom(int[] a, in int[] b) @trusted in{
     assert(a.length >= b.length);
} body {
     memmove(cast(void*)a.ptr, cast(void*)b.ptr, b.length * 
int.sizeof);
}

Is this ok? And if not, how should it be done, preferably without 
changing the condition or memmove call?


More information about the Digitalmars-d-learn mailing list