[Issue 12512] .dup of const structs does not work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 13 21:40:36 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12512

--- Comment #7 from Walter Bright <bugzilla at digitalmars.com> ---
(In reply to monarchdodra from comment #6)
> That's *still* a type where "const(T) : T": "Unqual!(const(int*))" is
> "const(int)*".

Ah, you're right.

> > Not going to do a .cdup
> 
> Fine.

Because where does it stop? .sdup for shared dup? .csdup for const shared dup?
At some point, it starts looking ridiculous.

> Could we then allow "dup" to return "const(T)[]" for the cases where
> it can't return a mutable then?

I suspect that would be considered surprising behavior.

--


More information about the Digitalmars-d-bugs mailing list