how to copy const struct with indirections to mutable one (of the same type)

drug via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Nov 29 02:59:51 PST 2016


29.11.2016 13:49, Mathias Lang пишет:
> On Tuesday, 29 November 2016 at 10:46:04 UTC, drug wrote:
>> I had the following code:
>> ```
>> import std.algorithm: equal;
>>
>> [...]
>
> You are not calling the (identity) opAssign here, but postblit.
>
> To call identity opAssign, you need an already constructed instance:
>
> ```
> Data mutable_data;
> mutable_data = const_data;
> ```

Thanks for clarification!


More information about the Digitalmars-d-learn mailing list