[Dlang-internal] Reply to Walter Bright

Olivier FAURE via Dlang-internal dlang-internal at puremagic.com
Sun Jan 29 03:24:31 PST 2017


On Sunday, 29 January 2017 at 11:20:48 UTC, Olivier FAURE wrote:
> Wait, then does that mean:
>
>     ref Container store(ref return scope c, return scope int* 
> ptr)
>     {
>         c.ptr = ptr;
>         return c;
>     }
>
>     void foobar()
>     {
>          Container c;
>          scope int*      ptr = ...;
>
>          scope Container c2 = ;
>          store(c, ptr);
>      }
>
> ...is legal?

Whoops. That is a typo. I meant


      ref Container store(ref return scope c, return scope int* 
ptr)
      {
          c.ptr = ptr;
          return c;
      }

      void foobar()
      {
           Container c;
           scope int*      ptr = ...;

           scope Container c2 = store(c, ptr);
       }



More information about the Dlang-internal mailing list