C++
Juan Jose Comellas
jcomellas at gmail.com
Sat Jul 1 05:31:11 PDT 2006
Well, I hope D gets const support somewhere in the near future, because it
is also needed to be able to pass parameters to threads efficiently (i.e.
without duplicating everything). There needs to be a way to specify that a
certain object is immutable when you pass it to a thread to avoid
unnecessary locking.
The lack of this feature is not much of a problem for small projects or when
you're only dealing with your own code, but once D takes off (as I believe
everybody here hopes it will) and we start using a lot of different D
libraries it will become an essential feature.
Deewiant wrote:
> Deewiant wrote:
>> Sean Kelly wrote:
>>> I've become convinced that the "default everything to const" method
>>> seems ideal, but this seems like something that should really be done
>>> before 1.0 if it's going to happen?
>>>
>>> Sean
>>
>> I agree. Walter posted somewhere in comp.lang.c++.moderated (I think it
>> was there) that he thinks he should have made D like this from the start,
>> but that it's too late now. With that, I disagree. We're not at 1.0 yet:
>> it's not
>> too late to break even every single line of D code out there.
>
> I found the post in question, BTW. Here's the Google Groups link:
>
>
http://groups.google.com/group/comp.lang.c++.moderated/tree/browse_frm/thread/d6695737a74e1853/18dc841928a6eee3?rnum=131&_done=%2Fgroup%2Fcomp.lang.c%2B%2B.moderated%2Fbrowse_frm%2Fthread%2Fd6695737a74e1853%2F840b0deea2987ee5%3Flnk%3Dst%26rnum%3D1%26#doc_3ff8dedacef55e17
>
> In summary:
>
> Andrei Alexandrescu says "Why, then, didn't D make const the default? C++
> had a good reason - C compatibility."
>
> Walter responds: "I should have. Too much water under the bridge for that
> now."
>
> In the same post Walter also acknowledges that "There has been some talk
> in the D newsgroups of doing that, but it has the potential to be
> extremely disruptive."
More information about the Digitalmars-d
mailing list