Why do we have transitive const, again?

Mehrdad wfunction at hotmail.com
Fri Sep 23 14:45:17 PDT 2011


On 9/23/2011 11:33 AM, so wrote:
> On Fri, 23 Sep 2011 21:21:31 +0300, Mehrdad <wfunction at hotmail.com> 
> wrote:
>
>> Er, you answered a question about const with an answer about 
>> immutable. :\
>>
>> My point is, what in the world does transitive const have to do with 
>> transitive immutable?
>> Can't you have immutable(T) be transitive while const(T) being 
>> "normal", as in C/C++? If not, why not?
>
> No you can't, i think you misunderstood the const in D. Without it 
> immutable is close to worthless. You would have to implement every 
> function for mutable and immutable.

Or just templatize it, like we've pretty much already been doing anyway...


More information about the Digitalmars-d mailing list