C++ guys hate static_if?

Timon Gehr timon.gehr at gmx.ch
Thu Mar 14 15:19:30 PDT 2013


On 03/14/2013 10:48 PM, Andrei Alexandrescu wrote:
> On 3/14/13 4:57 PM, Timon Gehr wrote:
>> ...
>>
>> The following breaks most of std.range, and most of std.algorithm could
>> likely be broken too, but I am too lazy to investigate.
> [snip]
>
> Nice point. The problem is an immutable TrollFace should not qualify
> pass the range tests.

Yes, that is one valid analysis of the situation.

> This could happen if there was a similar bug in a
> concept definition.

Yes. In which case it would be detected while the code is written, which 
is the point.

> So your argument does not move the ball on concepts
> vs static if.
>...

I'm not intending to move any balls here. The trade-offs are different.


More information about the Digitalmars-d mailing list