fork download
  1. #include <iostream>
  2. #include <memory>
  3.  
  4. class Foo {
  5. public:
  6. Foo(int crap) : mine_(crap) { }
  7. private:
  8. int mine_;
  9. };
  10.  
  11. int main() {
  12. std::shared_ptr<Foo> balls;
  13. std::shared_ptr<Foo> fooballs(new Foo(3));
  14.  
  15. if (fooballs == NULL) {
  16. std::cout << "Empty\n";
  17. } else {
  18. std::cout << "Hmm, nope\n";
  19. }
  20.  
  21. std::cout << "Wtf Ideone\n";
  22.  
  23. // your code goes here
  24. return 0;
  25. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Hmm, nope
Wtf Ideone