added copy constr

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48430 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2007-08-28 12:30:56 +00:00
parent ef36734a79
commit 369d17c075

View File

@@ -60,6 +60,7 @@ class MyCar
{
public:
MyCar( int price );
MyCar( const MyCar& data );
bool operator == ( const MyCar& car ) const;
bool operator != (const MyCar& car) const { return !(*this == car); }
@@ -82,6 +83,11 @@ MyCar::MyCar( int price )
m_data.get()->SetPrice( price );
}
MyCar::MyCar( const MyCar& car )
{
m_data.reset( car.m_data.get() );
}
bool MyCar::operator == ( const MyCar& car ) const
{
if (m_data.get() == car.m_data.get()) return true;