What guarantees does D 'const' provide, compared to C++?

Jesse Phillips jessekphillips+D at gmail.com
Fri Aug 17 21:18:30 PDT 2012


On Friday, 17 August 2012 at 22:05:56 UTC, Walter Bright wrote:
> On 8/17/2012 2:34 PM, Mehrdad wrote:
>> On Friday, 17 August 2012 at 20:46:02 UTC, Walter Bright wrote:
>>> On 8/16/2012 6:43 PM, Mehrdad wrote:
>>>> On Friday, 17 August 2012 at 01:25:18 UTC, Chris Cain wrote:
>>>>> Yeah. Again, you can't modify __the const view__.
>>>>
>>>> Isn't that kinda useless, if it tells you nothing about the 
>>>> object itself?
>>>
>>> It means you can write code that can process both mutable and 
>>> immutable objects.
>>
>> I meant from a C++/D comparison standpoint...
>
> I don't know what you're driving at.

He wants to know what optimizations you get from transitive const 
over C++ const when you ignore other D features such as immutable 
and pure.


More information about the Digitalmars-d mailing list