Overlapping functionality: IFTI, templates, is-expressions

Bill Baxter dnewsgroup at billbaxter.com
Sat Mar 22 18:05:04 PDT 2008


Russell Lewis wrote:
> Jason House wrote:
>> Russell Lewis wrote:
>>
>>> While I'm glad for the discussion about parsers, we lost track of the
>>> original post.  What do people think of my suggestions:
>>>
>>> * Make IFTI and template-specialization syntax sugar for is-expressions
>>> (in the right order so the deductions work properly)
>>
>> Since templates could eventually span multiple modules, I don't know 
>> if one
>> could simply write static if and is expressions to cover all 
>> functionality. When limited to a single module, I think there should 
>> be a one to one
>> mapping of some kind.
> 
> Do templates currently have the ability to span multiple modules?  With 
> other types of symbols, this type of overloading isn't allowed (you have 
> to use aliases to explicitly bring in overloads from other modules).  If 
> templates are the same way, then we don't have a problem.
> 
> And just to shortcut the OT discussion...this type of overloading seems 
> very wrong at first, but it is done by design because without it you 
> face some really nasty problems with large programs.  It's a "this makes 
> sense in hindsight design feature that we learned from C++."  Read 
> previous (long) NG threads about it.

Are you saying templates don't need to overload across modules?  If so, 
what is the D alternative to the non-intrusive traits template pattern 
used in C++?

--bb



More information about the Digitalmars-d mailing list