D constness: head & tail

drug via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Mar 2 04:04:40 PST 2015


On 02.03.2015 14:51, Jonathan M Davis via Digitalmars-d-learn wrote:
> On Monday, March 02, 2015 14:20:45 drug via Digitalmars-d-learn wrote:
>> I'm just trying to study constness in D and periodically fails with it.
>> Thanks for answer.
>> Then I guess that constness in D is in the finished form, hasn't some
>> pitfalls, won't be changed significantly in some future and so I just
>> need to learn it and understand it?
>
> Pretty much, yeah. const in D is what it's going to be. That involves some
> pros and cons in comparison to what C++ has, so in some ways it's going to
> be better, and in others, it's going to be frustrating in its restrictions
> (e.g. it doesn't work with anything that would require the mutable keyword
> in C++), but it's the way that it's going to be in D.
>
> - Jonathan M Davis
>
Yes, const in D is both exciting and frustrating thing. Thanks again.


More information about the Digitalmars-d-learn mailing list