
10 Jun
2011
10 Jun
'11
12:05 a.m.
On 9/06/2011, at 8:02 PM, Yves Parès wrote:
Were templates an original feature of C++ or did they appear in a revision of the langage ?
The latter. "C with classes" did not have multiple inheritance, exceptions, or templates. Note that C++ templates are *not* the same kind of animal as Eiffel generics or Java generics or Ada generics or Haskell parametric polymorphism. The C++ template language lets you do type-level functional programming, and different instances of a common "type constructor" may in fact have quite different internal structures. C++ templates are NOT 'merely keywords around .. parametric polymorphism', they are a far more dangerous thing.