This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: type_info::name question
- To: Ryszard Kabatek <rysio at rumcajs dot chemie dot uni-halle dot de>
- Subject: Re: type_info::name question
- From: Todd Vierling <tv at pobox dot com>
- Date: Mon, 14 Sep 1998 10:37:55 -0400 (EDT)
- cc: egcs at cygnus dot com
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)