This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g++ 2.95 typeinfo::name()
- To: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Subject: Re: g++ 2.95 typeinfo::name()
- From: "Kellogg, Oliver" <Oliver dot Kellogg at vs dot dasa dot de>
- Date: Tue, 23 Jan 2001 09:04:23 +0100
dewar at gnat dot com wrote:
> Some would argue that "useful
> " implementations of impl-defined stuff are inherently undesirable
> since they encourage non-portable programming, so who is to judge
> what is useful and not useful, [...]
Here is what I was trying to do.
template <class Interface>
class T {
private:
string _name;
public:
T () : _name (typeid (Interface).name ()) {}
virtual ~T () {}
const char *name () const { return _name.c_str (); }
void export_to_corba_naming_service ();
};
The export method exports the _name to a CORBA naming service.
Importers have knowledge of the class name, but do not have
knowledge of the convention used by the particular RTTI
system for determining this name. I guess what I'm saying is
I may not do stuff like this. Thus, the typeinfo::name() is
useless in this particular case.
Thanks.
Oliver M. Kellogg