Connecting Tech Pros Worldwide Forums | Help | Site Map

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

PengYu.UT@gmail.com
Guest
 
Posts: n/a
#1: Nov 8 '05
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


mlimber
Guest
 
Posts: n/a
#2: Nov 8 '05

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


PengYu.UT@gmail.com wrote:[color=blue]
> 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[/color]

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....fce0636fea3f16

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

Closed Thread


Similar C / C++ bytes