Implicit conversion to mutable if no indirections?

Nick Treleaven nick at geany.org
Tue Sep 6 17:45:50 UTC 2022


On Tuesday, 6 September 2022 at 10:06:59 UTC, Quirin Schroll 
wrote:
> * Aforementioned `const(int*)` becoming `const(int)*`. That 
> does not happen with custom `struct S(T)` automatically even in 
> cases where it is provably correct, and there is no way to tell 
> the D compiler that copies of `const(S!int)` are better 
> understood to be `S!(const int)`.

There is at least a library pattern:
https://dlang.org/blog/2020/06/25/a-pattern-for-head-mutable-structures/


More information about the Digitalmars-d mailing list