digitalmars.D - slight correction for templates intro
- Bill Baxter (12/12) Oct 15 2006 On the templates revisited page:
- Walter Bright (1/1) Oct 15 2006 Will do. Thanks.
On the templates revisited page: http://www.digitalmars.com/d/templates-revisited.html It gives some example of C++ templates: template<T, U> class Bar { ... }; template<T, U> T foo(T t, U u) { ... } template<T, U> static T abc; These should have 'class' or 'typename' before the type parameters: template<class T, class U> class Bar { ... }; template<class T, class U> T foo(T t, U u) { ... } template<class T, class U> static T abc; Makes the D version look even cleaner. :-) --bb
Oct 15 2006