The rfind challenge

Timon Gehr timon.gehr at gmx.ch
Tue Jan 15 05:43:12 PST 2013


On 01/15/2013 02:30 PM, Timon Gehr wrote:
>
> /+pure+/ R tail(R)(R r)out(result){
>      assert(result=={
>          auto a=r;
>          a.popFront();
>          return a;
>      }());
> }body{
>      auto a=r;
>      a.popFront();
>      return a;
> }

Obviously, this should be

/+pure+/ R tail(R)(R r)out(result){
     assert(result=={
         auto a=r.save;
         a.popFront();
         return a;
     }());
}body{
     auto a=r.save;
     a.popFront();
     return a;
}



More information about the Digitalmars-d mailing list