Any package for printing out type information for debugging programs using templates?

P

PengYu.UT

I found that it is extremely unproductive to debug programs using
templates a lot. Although I could manually define some types to help
printing out type informations, it is still tedious for me. Are there
any package available for this purpose?

Thanks,
Peng
 
M

mlimber

I found that it is extremely unproductive to debug programs using
templates a lot. Although I could manually define some types to help
printing out type informations, it is still tedious for me. Are there
any package available for this purpose?

Thanks,
Peng

You could use the typeid operator and std::cout. The content returned
by type_info::name() is implementation-defined, but it might be
sufficient for your needs.

Also, you might consider using the script mentioned in response to one
of your previous questions on templates:

http://groups.google.com/group/comp.lang.c++/msg/e0fce0636fea3f16

It generates classes from template definitions so you can see the final
product, though it won't work with all modern template features.

Cheers! --M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top