This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: type_info::name question


On Mon, 14 Sep 1998, Ryszard Kabatek wrote:

: Is there any possibility to get the class name from type_info::name?
: 
: For typeid(string).name() I get:
: 't12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0'.

This is the mangled name of the fully qualified class "string".  If you add
two underscores (three on platforms that need leading underscores) and run
it through c++filt, you get something useable, but it still won't say
"string"--it cannot in this case, since string is a template.

The name is mangled such that it is machine-useable.  The output of
typeinfo::name() isn't guaranteed to be human-readable.

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]