Head Const

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 15 19:48:59 PST 2016


On Mon, 15 Feb 2016 16:57:44 -0800, H. S. Teoh via Digitalmars-d wrote:

> What about besides C++ integration?  'cos I remember some people were
> complaining that a library solution is bad, but I've forgotten what the
> reasons were.

The first problem mentioned was C++ integration, and the minimal thing 
required to make that work in a nice way is to supply a @cppconst 
attribute with no semantics that is used only to alter name mangling. 
It's the least complex solution available.

I did get tripped up not too long ago on a lack of a `final` storage 
class in the context of members. It is sometimes useful.

There's also a question of whether we want the same thing for C++ name 
mangling as for preventing reassignment. It might be clearer to have both 
final and @cppconst.


More information about the Digitalmars-d mailing list