On 2012-04-09 17:30, Steven Schveighoffer wrote:

// 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

Ok, that works. But then I want to modify the clone:

void bar (const Foo foo)
{
    auto c = foo.clone();
    c.data = ...
}

But now "c" is const. I don't want "c" to be const, I just want "foo" to be const.

--
/Jacob Carlborg

Reply via email to