Struct copy constructor with inout

dhs dhs at email.com
Tue Nov 14 14:36:57 UTC 2023


On Tuesday, 14 November 2023 at 13:58:17 UTC, Paul Backus wrote:
> On Tuesday, 14 November 2023 at 13:41:32 UTC, Steven
>
> The error is saying that the copy constructor expects a `const` 
> `this` argument, but you're passing a mutable `this` argument.
>

Thanks you both very much for answering.

Just to clarify some more: isn't "s1 = ss1" similar to something 
like:

```d
     const(S1) s1;
     S1 ss1; // ss1 is now S1.init
     S1_copy_construct_const_in_const_out(ss1, s1);
```

If this is the case, the compile error is expected, but 
why/how/where do "implicit qualifer conversions" apply here?

Thanks again,
dhs


More information about the Digitalmars-d-learn mailing list