SmartPtr template library