fork download
  1. #include <memory>
  2.  
  3.  
  4. std::shared_ptr<int> factory(int arg)
  5. {
  6. return std::make_shared<int>(arg);
  7. }
  8.  
  9. std::shared_ptr<int> use_factory(int arg)
  10. {
  11. auto p = factory(arg);
  12. return p;
  13. }
  14.  
  15. int main(int argc, char *argv[])
  16. {
  17. use_factory(14);
  18. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty