Interfaces and Template Specializations

Jarrett Billingsley jarrett.billingsley at gmail.com
Sat Jan 10 14:52:32 PST 2009


On Sat, Jan 10, 2009 at 5:40 PM, dsimcha <dsimcha at yahoo.com> wrote:
> Overall, though, D2's compile-time reflection system grew very organically and has
> a lot of duplicated features.  There's been some discussion in the past about how
> to reduce this complexity by removing redundancy.  You may have stumbled on one
> here:  Constraints, as far as I can tell, are just a more general case of template
> specialization.  Maybe we don't need template specialization anymore.

Not to hijack the thread, but yes - we no longer need template
specialization.  But we don't necessarily need to kill the syntax,
since "template Foo(T: int) {}" is certainly shorter than "template
Foo(T) if(is(T: int)) {}".  Simply rewrite the former as the latter,
problem solved.



More information about the Digitalmars-d mailing list