Quote:Original post by d000hg
Oh, OK. I thought Templated classes were just special classes. So actually
they're a dirty hack? If I define the function body in the class declaration
are they still inline functions - I probably don't want that.
actually they are a powerful tool that many languages would die to have
available, and also opened possibilities leaps and bounds ahead of their time.
notice how Java 1.5 has introduced "generics" ?
your second point: the compiler is a wicked-smart peice of software, so you
shouldn't worry about speed unless you're planning on some uber-cryptic code,
if it's just because you don't like the layout you can implement your code and
save it as a ".inl" file (any extension you like, commonly .inl) and at the
bottom of the .h file you include the file: #include "MyTemplateImpl.inl"
that tends to work quite well in most situations (and I'm unaware of those
for which it wont).
Cheers
-Danu