Head Const

Daniel Murphy via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 15 16:15:07 PST 2016


On 16/02/2016 9:48 AM, Walter Bright wrote:
> rears its head again :-)
>
> Head Const is what C++ has for const, i.e. it is not transitive, applies
> to one level only. D has transitive const.
>
> What head const will do for us:
>
> 1. make it easy to interface to C++ code that uses const, as currently
> it is not very practical to do so, you have to resort to pragma(mangle)
>

I'd much rather improve pragma(mangle) than add more C++ features to D.

> 2. supports single assignment style of programming, even if the data is
> otherwise mutable

Like 'final'?  We did get rid of that...


More information about the Digitalmars-d mailing list