one step towards unification of std.algorithm and std.string
Denis Koroskin
2korden at gmail.com
Thu Dec 31 12:07:52 PST 2009
On Thu, 31 Dec 2009 16:37:57 +0300, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> 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
You won't be able to call opEquals on immutable objects if opEquals would
require mutable pointer.
More information about the Digitalmars-d
mailing list