Topic: Is this a valid conversion by the standard?
Author: "Sievert, James A" <James.Sievert@UNISYS.com>
Date: 1998/08/28 Raw View
Given:
class C1 {};
class C2 : public C1 {};
template< class Type >
class CPtr
{
public:
CPtr( Type *p ) : m_p( p ) {}
template< class T >
operator T *() { return m_p; }
private:
Type *m_p;
};
C2 c2;
CPtr< C2 > hC2( &c2 );
Does operator T* () allow C1 *pC1 = hC2?
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]