[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[OT] C++ templates and debugging (limitations) in Linux


This is related to templates in C++ and debugging tools we have in Linux
(I use gdb, is there any other comparable open source tool?).

What do C++ programmers here think about the usefulness of using
templates in C++ while keeping in mind how it would work with debugging
that program using gdb.

I recall that a few years ago (a few version of gdb and gcc ago) I was
having trouble debugging an algorithm I implemented in C++ using
templates. I do not recall the exact problems but after a few online
searches it appeared that the easiest way was to not to use templates
(one problem was that I has having difficulty to examine template
variables). IIRC, gdb was not very friendly while debugging C++ code
with templates.

Can C++ programmers here share their recent experience in this regard? I
have a program for an engineering problem of around 5000 lines and I
need to change some of the data variable from one type to another.
Currently I am of the mind to just change the variable type. Would it be
worthwhile instead to use templates in this situation so that I can then
maintain only one copy for different data types? I am debugging the
source code using gdb and I am not sure if it will become much more
tedious to debug if I use templates. Comments and feedback are welcome.



Please reply to this list only. I read this list on its corresponding
newsgroup on gmane.org. Replies sent to my email address are just
filtered to a folder in my mailbox and get periodically deleted without
ever having been read.

Reply to: