C++ guys hate static_if?

Walter Bright newshound2 at digitalmars.com
Thu Mar 14 16:31:41 PDT 2013


On 3/14/2013 3:20 PM, Andrei Alexandrescu wrote:
> On 3/14/13 6:15 PM, Walter Bright wrote:
>> On 3/14/2013 3:02 PM, H. S. Teoh wrote:
>>> Under a concepts system, this would be caught early because the compiler
>>> would detect a concept mismatch (Unqual!T != T) when analysing the
>>> template code.
>>
>> How would that be different from simply adding a template constraint?
>
> The difference is without the constraint there's no error. It's all about the
> default: by default (no constraints) everything is allowed.

I meant how would a concept be better than a constraint for this example.



More information about the Digitalmars-d mailing list