Why do we have transitive const, again?

Mehrdad wfunction at hotmail.com
Fri Sep 23 15:27:55 PDT 2011


On 9/23/2011 2:55 PM, Jonathan M Davis wrote:
> On Friday, September 23, 2011 14:37 Mehrdad wrote:
>> On 9/23/2011 11:47 AM, Jonathan M Davis wrote:
>>> ...You'd have to duplicate functions all over the place... - Jonathan
>>> M Davis
>> Can't you avoid that trivially with templates?
> Then all of your functions have to be templated.
Right... but we're already doing that with Phobos anyway...

> Templated functions can't be
> virtual. And even if they _could_ be, that still requires that programmers
> template or duplicate functions all over the place. It not only increases the
> amount of bloat in the binary, but it creates more work for the programmer.
... didn't I mention the same thing before, regarding too many templates 
in Phobos? I thought I always said functions shouldn't be templated, but 
everyone said it's OK because (1) that's how it is in C++, (2) it's 
faster, (3) etc., etc... I'm really confused by your [seemingly] 
contradictory reasoning. :\

> Honestly, I don't understand what the problem with transitive const is.
> What are you trying to do that the transitiveness of const causes issues? I
> just don't see the problem.
>
> - Jonathan M Davis
Wait, what?
Haven't we already had enough complaints on the newsgroup about the 
problems with const? Are they all bogus or something?


More information about the Digitalmars-d mailing list