Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #11612

Re: How to avoid splitting namespace scope?

From laird@lbreyer.com
Newsgroups comp.lang.c++
Subject Re: How to avoid splitting namespace scope?
Date 2011-11-18 20:55 -0800
Organization http://groups.google.com
Message-ID <15905453.1326.1321678541309.JavaMail.geo-discussion-forums@prmf13> (permalink)
References <1e180097-a703-4bc9-bf7d-b51afaf245ea@a5g2000vbb.googlegroups.com>

Show all headers | View raw


If all you want is a string describing the class, have you considered using the typeid operator?

S::A a;
cout << typeid(a).name() << endl;

or create a single global Tag function template:

template<class T> string Tag(T& t) { return typeid(a).name(); }

Laird Breyer.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to avoid splitting namespace scope? Jayden Shui <jayden.shui@gmail.com> - 2011-11-18 18:58 -0800
  Re: How to avoid splitting namespace scope? laird@lbreyer.com - 2011-11-18 20:55 -0800
    Re: How to avoid splitting namespace scope? Jayden Shui <jayden.shui@gmail.com> - 2011-11-18 21:27 -0800
      Re: How to avoid splitting namespace scope? laird@lbreyer.com - 2011-11-18 22:19 -0800
  Re: How to avoid splitting namespace scope? "Bo Persson" <bop@gmb.dk> - 2011-11-19 10:55 +0100

csiph-web