[TriLUG] OT: A C++ Templated Class Problem

Tanner Lovelace clubjuggler at gmail.com
Mon Apr 17 12:12:22 EDT 2006

On 4/17/06, Owen Berry <oberry at trilug.org> wrote:
> On Fri, Apr 14, 2006 at 12:54:20PM -0400, Owen Berry wrote:
> > Templates are powerful, but IMHO they just aren't that easy to read and
> > understand in the first place.
> I don't know why I said this - must have been Friday rot setting in or
> something. Templates are powerful and I use them. The code can start to
> look messy, when you have template containers containing templated
> types, for example, but typedef's are really handy for cleaning this up.
> So I recant on the above position.

Yeah, I do agree with that.  Of course, classes that contain classes
that contain classes, etc.. have the same problem.

> That said, template usage for the sake of template usage should be
> avoided. Which is the case for almost anything.

Definitely.  Templates are useful for certain things and not
for others and the trick is definitely figuring out when the
right time is.  I think that can sometimes be more difficult
for some people than actually writing the templates.

> Now hopefully the Monday rot hasn't set in already. :-)


Tanner Lovelace
clubjuggler at gmail dot com
(fieldless) In fess two roundels in pale, a billet fesswise and an
increscent, all sable.

More information about the TriLUG mailing list