[Doxygen-develop] Smart Pointers
Brought to you by:
dimitri
From: Robert N. <rn...@re...> - 2011-03-08 21:57:48
|
I'm implementing support for smart pointers. I have the operator ->() part working but I'm hitting a problem with typedefs and was hoping someone could point me in the right direction. For example given the following code: template<class T> class CPointer { public: T *operator ->(void) const { return m_pObject; } private: T * m_pObject; }; class CTest { public: void Func(void) { } }; CPointer<CTest> pTest; typedef CPointer<CTest> CTestPtr; CTestPtr pTest2; pTest->Func(); // Works pTest2->Func(); // Doesn't work. |