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


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


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