Oh yes, having newly been using C++ at work, I realized they were a "big something" [1] that enabled you, as it were, to do whatever unstructured unholy type trickery you want, and yes, even making classes A<B> and A<C> completely different things. (BUT! We could argue over this fact: Isn't it also one of the purposes of... Type Families? Where the TF Foo :: * -> *, can yield to datatypes Foo String and Foo Int being completely different and unrelated?)<br>
I was more saying that you could roughly "emulate" Haskell classes in C++ with templates (minus a good type security).<br><br>[1] Vernacular, isn't it?<br><br><br><div class="gmail_quote">2011/6/10 Richard O'Keefe <span dir="ltr"><<a href="mailto:ok@cs.otago.ac.nz">ok@cs.otago.ac.nz</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
On 9/06/2011, at 8:02 PM, Yves Parès wrote:<br>
<br>
> Were templates an original feature of C++ or did they appear in a revision of the langage ?<br>
<br>
</div>The latter. "C with classes" did not have multiple inheritance, exceptions, or templates.<br>
<br>
Note that C++ templates are *not* the same kind of animal as Eiffel generics or Java generics<br>
or Ada generics or Haskell parametric polymorphism. The C++ template language lets you do<br>
type-level functional programming, and different instances of a common "type constructor" may<br>
in fact have quite different internal structures. C++ templates are NOT 'merely keywords<br>
around .. parametric polymorphism', they are a far more dangerous thing.<br>
<br>
</blockquote></div><br>