smart_ptr with template