C++'s std::rotate

"Nordlöw" via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 11 02:11:34 PDT 2014


On Monday, 11 August 2014 at 06:56:52 UTC, Dragos Carp wrote:
> bool sliceOf(T)(in T[] whole, in T[] slice)
> {
>     return whole.ptr <= slice.ptr &&
>         whole.ptr + slice.length <= whole.ptr + slice.length;
> }

Shouldn't the function arguments of sliceOf be reversed to given 
a more intuitive UCFS as

     if (slice.sliceOf(whole) { ... }

?


More information about the Digitalmars-d mailing list