fork download
  1. #include <iostream>
  2. #include <memory>
  3. #include <string>
  4.  
  5. int main() {
  6. std::shared_ptr<std::string> pointer = nullptr;
  7. auto ptr = std::make_shared<std::remove_reference<decltype(*pointer)>::type>("hello");
  8. std::cout << *ptr;
  9. return 0;
  10. }
Success #stdin #stdout 0s 4260KB
stdin
Standard input is empty
stdout
hello