C++0x Concepts - Dead?

aarti_pl aarti at interia.pl
Thu Jul 16 16:48:12 PDT 2009


Walter Bright pisze:
> aarti_pl wrote:
>> Walter Bright pisze:
>>> aarti_pl wrote:
>>>> How would you do currently in D?
>>>
>>> template (T) if (T.init + T.init)
>>> {
>>> }
>>
>> in D1.0
>>
>> template(T if typeof(T.init + T.init) == T)
> 
> D1 is closed to such enhancements, in any case, the ==T part is wrong. 
> byte+byte==int, for example.

I don't want to dive into it. It has nothing to do with origins of this 
discussion. You asked - I answered :-)

> 
>> or in D2.0
>>
>> template(T if __traits(compiles, T.init + T.init))
>>
>> I could mess something in above examples, but as you can see, getting 
>> it to work is not a problem of my syntax for templates.
> 
> Ok, but it's hard to see why it is better.

So you suggest that advantage of "if constraint" is possibility to get 
compile time information about types?

In my opinion they are completely different concepts and they should be 
separated. In most cases messing two concepts together is wrong.

Advantages of my syntax are enumerated in my proposal. I will not repeat 
them here again.

BR
Marcin Kuszczak
(aarti_pl)


More information about the Digitalmars-d-announce mailing list