一段没看懂的代码,请Boss们help me!
代码如下:
template<typename T> class OwnPtr{
public:
typedef typename RemovePointer<T>::Type ValueType;
typedef ValueType* PtrType;
// 没看懂的就是下面这两行,这两行实现什么功能?
typedef PtrType OwnPtr::*UnspecifiedBoolType;
operator UnspecifiedBoolType() const { return m_ptr ? &OwnPtr::m_ptr : 0; }
};
不懂的代码在注释中,请高手给指点。多谢,多谢,再谢。