What's wrong with D's templates?
Walter Bright
newshound1 at digitalmars.com
Mon Dec 21 22:28:10 PST 2009
grauzone wrote:
> Walter Bright wrote:
>> I believe that D's template constraint feature fills the bill, it does
>> everything Concepts purported to do, and more, in a simple and easily
>> explained manner, except check the template body against the constraint.
>>
>> The latter is, in my not-so-humble opinion, a desirable feature but
>> its desirability is overwhelmed by the payment in complexity and
>> constrictions on the Concepts necessary to make it work.
>
> I seriously wonder why you're saying that, while at the same time
> clinging on overcomplicated failures such as const/immutable/pure or
> auto ref etc...
Because there is a large payoff to immutability and purity, and they are
far simpler than Concepts.
Consider that Concepts required more pages to specify than the entire
template feature in C++.
I can expound on the huge advantages immutability and purity offer, if
you want.
More information about the Digitalmars-d
mailing list