C++'s std::rotate

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 11 07:45:13 PDT 2014


On 8/11/14, 2:11 AM, "Nordlöw" wrote:
> 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) { ... }

isSliceOf -> yum



More information about the Digitalmars-d mailing list