one step towards unification of std.algorithm and std.string

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Dec 31 05:37:57 PST 2009


grauzone wrote:
> Andrei Alexandrescu wrote:
>> bearophile wrote:
>>> I don't know C++ much, and I have to confess that I have to fully 
>>> understand the const business still. I hope your book will teach me 
>>> this topic very well :-)
>>
>> One thing about const that is slowly downing on this community is that 
>> it will _not_ be used as often as in C++. It will be rare, and the 
>> compiler and standard library should not require it without very good 
>> reason. I think opEquals for classes is at fault for requiring const.
> 
> Interesting statement. Does this apply to immutable as well, or only 
> const? Because I thought const/immutable was supposed to make program 
> logic clearer etc... That implied it would be heavily used in "normal" 
> code. That's all a bit vague to me, care to clarify this a bit?

The statement doesn't apply to immutable because C++ doesn't have it.

Andrei



More information about the Digitalmars-d mailing list