Smart pointers and overloading