16 Jul
2006
16 Jul
'06
10:56 p.m.
Zhuo Hao wrote:
<snap>
I wonder how it is implemented that we cannot pass zero as a pointer to Y in the constructor of shared_ptr.
Consider: template <class U> class P { public: template <class V> P(V * v) : u(v) {} private: U *u; }; Now "P<CMutex> p1(0);" will not compile but "P<CMutex> p1(new CMutex);" will. -delfin