Comparison chart of D and C++ templates

Kazuhiro Inaba kiki at kmonos.net
Fri Jan 19 02:58:24 PST 2007


>                          D  C++98 C++0x
>Partial Specialization | Yes  Yes  NoChange

Actually, partial specialization in D is a kind of yes-and-no.
In C++98, we can do this:
  template<class T, class U>
    class Foo< map<T,U> > { ... }; // Partially specialized to "associative arrays"
while in D, cannot:
  class Foo(T: /* ? */) {}

Combination of staticIf/typeof/IFTI may achieve the same effect,
but in my opinion it is not partial specialization anymore.

-- 
k.inaba / 稲葉一浩 (http://www.kmonos.net)



More information about the Digitalmars-d-announce mailing list