D - Template-aliases and typedefs
- Matthias Becker <Matthias_member pathlink.com> Jan 27 2004
- Andy Friesen <andy ikagames.com> Jan 27 2004
- Matthias Becker <Matthias_member pathlink.com> Jan 27 2004
Just an idea: What about template-aliases and typedefs alias(T) OherTemplate(T, T, int) MyAlias; MyAlias!(double) foo;
Jan 27 2004
Matthias Becker wrote:Just an idea: What about template-aliases and typedefs alias(T) OherTemplate(T, T, int) MyAlias; MyAlias!(double) foo;
The 'class Foo(T)' template form is a shorthand for: template Foo(T) { class Foo { ... } } So, if you want a template typedef, you just do: template MyAlias(T) { alias OtherTemplate!(T, T, int) MyAlias; } MyAlias!(double) foo; Kinda cool that D gets things that haven't even made it into C++, merely as a side effect of its design. :) -- andy
Jan 27 2004
The 'class Foo(T)' template form is a shorthand for: template Foo(T) { class Foo { ... } } So, if you want a template typedef, you just do: template MyAlias(T) { alias OtherTemplate!(T, T, int) MyAlias; } MyAlias!(double) foo; Kinda cool that D gets things that haven't even made it into C++, merely as a side effect of its design. :)
Jan 27 2004








Matthias Becker <Matthias_member pathlink.com>