Use shared_ptr if possible regardless of C++11 support