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: g++ 2.95 typeinfo::name()


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

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