digitalmars.D - Template specialization
- Li Jie (6/6) Apr 18 2006 I don't know what is the name of this usage:
- Hasan Aljudy (17/28) Apr 18 2006 Are you sure? I just tried, and the following works:
- Li Jie (26/54) Apr 19 2006 Oh. It's different.
I don't know what is the name of this usage: template <class T> class SomeClass{}; template <class T, class U> class SomeClass< AnotherClass<T,U> >{}; I think this is very commonly used, but D hasn't supported it yet, Is it in the plain? - Li Jie
Apr 18 2006
Li Jie wrote:I don't know what is the name of this usage: template <class T> class SomeClass{}; template <class T, class U> class SomeClass< AnotherClass<T,U> >{}; I think this is very commonly used, but D hasn't supported it yet, Is it in the plain? - Li JieAre you sure? I just tried, and the following works: class SomeClass(T) { T x; } template AnotherClass(T,U) { class AnotherClass( SomeClass(T) ) { } } void main() { }
Apr 18 2006
In article <e24ltq$2g7f$1 digitaldaemon.com>, Hasan Aljudy says...Li Jie wrote:Oh. It's different. // c++ version: That looks like "implicit template parameters type deduce" + "template specialization". How to do it in D? static if?I don't know what is the name of this usage: template <class T> class SomeClass{}; template <class T, class U> class SomeClass< AnotherClass<T,U> >{}; I think this is very commonly used, but D hasn't supported it yet, Is it in the plain? - Li JieAre you sure? I just tried, and the following works: class SomeClass(T) { T x; } template AnotherClass(T,U) { class AnotherClass( SomeClass(T) ) { } } void main() { }
Apr 19 2006