any news on const/invariant?

Extrawurst spam at extrawurst.org
Mon Nov 26 15:20:18 PST 2007


Walter Bright schrieb:
> Bill Baxter wrote:
>> Denton Cockburn wrote:
>>> Any update on the status of the const/invariant changes?
>>>
>>> I'm using D 2.0 in some things, and would hate to learn to do it X way,
>>> only to have it changed on me.
>>
>> You can get a preview of the new way things are going to look by 
>> browsing the latest source of Phobos from dsource.
>>
>> I didn't spend too much looking through the changes, but it looked 
>> like D is going to be switching to the C++ style of flagging 'this' 
>> as const by putting 'const' at the end of the function signature 
>> rather than the beginning.
>
> At the beginning will still work for function types. The at the end 
> option is there for those who are building complex type declarations.

honestly i would prefer just one single way of writing things. allowing 
multiple ways makes it less simple to understand external code for 
beginners. this is one thing i like about java that there hardly exist 
multiple ways to formulate the same piece of code.



More information about the Digitalmars-d mailing list