SmartPtr class