Overlapping functionality: IFTI, templates, is-expressions

Jason House jason.james.house at gmail.com
Sat Mar 22 18:00:36 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.

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.


> 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.

I wonder a bit if the overload sets (an upcoming feature of D2) would be
useful for templates as well...



More information about the Digitalmars-d mailing list