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

Steven Schveighoffer <schvei...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schvei...@gmail.com

--- Comment #5 from Steven Schveighoffer <schvei...@gmail.com> ---
An idea that just came up on discord -- what if D just pretended C head const
was mutable? In practice, you are making a copy anyway, and the implementation
isn't actually affected since you might assume that the code would already be
compiling on existing C compilers.

Credit to Adam Ruppe for the idea.

So in the example, `int * const p` just becomes `int * p`, along with all the
other code pieces.

You can keep the fact that const was present in the AST as a note, in case you
need to print something or in case you at some point decide to enforce
head-const.

--

Reply via email to