type_info::name question

Thomas Kunert kunert@physik.tu-dresden.de
Mon Sep 21 03:54:00 GMT 1998


Alexandre Oliva wrote:
> 
> Thomas Kunert <kunert@physik.tu-dresden.de> writes:
> 
> > IMHO, type_info::name isn't useful at all if it returns some cryptic
> > string.
> 
> type_info::name *isn't* useful at all, as defined in the standard.  

Only if one clings to the paper as you do. 
The function is called `name', not `some_arbitrary_string'. IMO, that is
description enough. 

``Implementation defined'' doesn't mean ``as unuseful as possible to
prevent portability problems'' but ``make the best of it, everybody
should know about portability''. And if the function does what it's name
suggests -- giving the name of the type in some readable language -- it
*is* useful.

> If you really want a readable representation,
> I've already explained that it's just a matter of running c++filt or
> embedding it into your application.

Of course I can do that, in fact I have done this a long time ago, to
port some perfectly working code to egcs, but I hate rewriting functions
from the standard library only because of some weird chosen
implementation defined values.

Regards, 
Thomas



More information about the Gcc mailing list