www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - slight correction for templates intro

reply Bill Baxter <wbaxter gmail.com> writes:
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
parent Walter Bright <newshound digitalmars.com> writes:
Will do. Thanks.
Oct 15 2006