The new ?? and ??? operators

Janice Caron caron800 at googlemail.com
Wed Sep 26 07:57:59 PDT 2007


On 9/26/07, Janice Caron <caron800 at googlemail.com> wrote:
>     SnazzyFunctor firstOf(lazy int * p)
>     {
>         return new SnazzyFunctor(p);
>     }

Come to think of it, it should work with one fewer lazy:

   SnazzyFunctor firstOf(int * p)
   {
       return new SnazzyFunctor(p);
   }

since you're always going to want the first one to execute, and the
recursive call has already been evaluated. So, even simpler then!



More information about the Digitalmars-d mailing list