On Mon, 09 Apr 2012 11:22:54 -0400, Jacob Carlborg <[email protected]> wrote:

On 2012-04-09 16:52, Timon Gehr wrote:
On 04/09/2012 04:49 PM, Jacob Carlborg wrote:

But now when I compile this code I get this error:

Error: cannot implicitly convert expression (this.data) of type
const(void*) to void*

Any idea how to solve this? Or would I need to drop const.

--
/Jacob Carlborg

Either clone the data too or use inout.

Where would I use inout, on "clone"?


// untested
inout(Foo) clone() inout {
   return new inout(Foo)(data);
}

Note, you can't post-assign data, since inout is effectively const inside an inout function.

-Steve

Reply via email to