Smart Pointers
Robert Nelson <[email protected]>
| Newsgroups | gmane.text.doxygen.devel |
|---|---|
| Message-ID | <[email protected]> |
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.
------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d