Unfortunately, the functor argument is not a reference to the SmartPtr but a void *. Making functor argument a reference to the pointer would require the FunctionStorage template to know the full definition of the SmartPtr.