Pelle:

> bool isRotated(T)(T[] a, T[] b) {
>      return a.length == b.length && (a.length == 0 || 
> canFind(chain(a,a), b));
> }

Nice clean solution. I suggest to add "pure" and two "const" in the signature.


> canFind isn't really the best possible name, is it?

Some name/APIs of Phobos are not the best possible, they were often invented by 
a single person. I don't know if contains() or isIn() are better.

Bye,
bearophile

Reply via email to