I am currently using boost :: intrusive_ptr along with my GUIs. Although this is a more or less convenient question, is there a way to get the name of the current class? The reason I'm asking is because I have a macro for typedef'ing different types of pointers:
#define INTRUSIVE_PTR_TYPEDEFS(CLASSNAME) typedef boost::intrusive_ptr<CLASSNAME> Ptr; \ typedef boost::intrusive_ptr<const CLASSNAME> CPtr; \ typedef CLASSNAME* WeakPtr; \ typedef const CLASSNAME* CWeakPtr; ... class Widget { public: INTRUSIVE_PTR_TYPEDEFS(Widget); ... }; class Button : public Widget { public: INTRUSIVE_PTR_TYPEDEFS(Button); ... };
It would be much more convenient to automatically output CLASSNAME so that you can simply copy it to the body of the class. I am using the compiler that comes with Visual Studio 2010.
Thanks in advance!
source share