Proposal: static template(fail)

BCS ao at pathlink.com
Fri Dec 14 13:07:44 PST 2007


Reply to Janice,

> On 12/14/07, BCS <ao at pathlink.com> wrote:
> 
>> That only works if the maintainers of the two templates work
>> together. Here is an example where they wouldn't be:
>> 
> Gotcha. Well, it seems doable, so long as there is zero chance of
> order-dependency creeping it. That would be my only worry.
> 
> If order dependency does turn out to be an issue, then it might be
> wise to consider the alternative (and I believe, equivalent)
> suggestion:
> 
> template A(T:if(someTest!(T)))
> {
> /*code*/
> }
> which would eliminate the need for that sort of overloading, but still
> give just as much power to template programming.
> 

I think that would be preferable in some ways because it would place the 
logic in a consistent place. OTOH it forces the logic into a "single expression" 
form. I guess you can always push the login into another template.

In the end it's the functionality I want, as long as the syntax is usable 
it's all the same to me.





More information about the Digitalmars-d mailing list