This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: type_info::name question
- To: egcs at cygnus dot com
- Subject: Re: type_info::name question
- From: Nathan Myers <ncm at nospam dot cantrip dot org>
- Date: Sat, 19 Sep 1998 18:54:50 -0700
- Newsgroups: cygnus.egcs
- Organization: http://www.cantrip.org/
- References: <3602EA79.936D5EAC@nospam.cantrip.org>, <199809191751.TAA00242.cygnus.egcs@mira.isdn.cs.tu-berlin.de>
Martin von Loewis wrote:
> > uses it won't be conforming. With member name() there is at least
> > a chance, if the compiler implementors co-operate.
>
> This is what makes this approach particularly bad. Using the standard
> method will make it compile, yet it works in an implementation-defined
> way. Most users won't be aware of these details, and run into problems
> without being warned.
I can't accept that. The RTTI feature is a hook for support of object
databases and the like. Anybody using it is painfully aware of the
cross-platform issues.
> I'm not against g++ giving some additional guarantees about the string
> returned by name(); I just think it is bad advice to use name() as
> long as there no guarantees (unless it is used for debugging).
>
> For example, g++ could warn if name is called, while the user did not
> request specific semantics for it.
This would be a good thing. In the absence of such a request the RTTI
records could be smaller, which would also be a good thing.
Nathan Myers
ncm@cantrip.org