Use std::shared_ptr<T> if C++11 is available

Use standard ```std::shared_ptr<T>``` rather than the built-in smart pointer if C++11 is available.