Overlapping functionality: IFTI, templates, is-expressions

BCS ao at pathlink.com
Sat Mar 22 19:24:50 PDT 2008


Reply to Jason,

> posts by others lead me to believe that they can't right now.  The
> same posts also talk about why that's a problem.  For example, a
> custom traits class may know nothing about a new user defined type,
> and to work would require a specialization for the new type.
> 

The best I expect you could do would be to have the new UDT generate some 
hooks to be used by the traits lib. I kind of do some of this in some of 
my template coding. I have a number of places where I expect a template end 
up as a type with certain members (I end up duck typing stuff) and what not. 
Another one that would be interesting would be to require the UDT to defined 
code generators that the lib then calls and mixes in.

Short of something like that, I think your sunk whatever you do. One side 
needs to know about the other side at some level. The alternative (no body 
known about anybody but it all just works) was the objective of M$'s IP project. 
They called it an abstraction ecology. After 10 years and untold millions 
they had "the world most expensive C compiler" and no ecology.





More information about the Digitalmars-d mailing list