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

Discussion in 'C++' started by PengYu.UT@gmail.com, Nov 8, 2005.

  1. Guest

    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
    , Nov 8, 2005
    #1
    1. Advertising

  2. mlimber Guest

    wrote:
    > 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
    mlimber, Nov 8, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page