fork(1) download
  1. #include <iostream>
  2. #include <memory>
  3.  
  4. class Base
  5. {
  6. public:
  7. Base() {}
  8. };
  9.  
  10. class Derived : public Base
  11. {
  12. public:
  13. Derived() {}
  14. Derived(std::initializer_list<std::pair<int, std::shared_ptr<Base>>>) {}
  15. };
  16.  
  17. int main(int argc, char ** argv)
  18. {
  19. // auto example = new Derived({
  20. // { 0, std::make_shared<Derived>() }
  21. // });
  22.  
  23. // auto example = new Derived({
  24. // { 0, std::make_shared<Derived>({
  25. // { 0, std::make_shared<Derived>() }
  26. // }) }
  27. // });
  28.  
  29. auto example = new Derived({
  30. { 0, std::make_shared<Derived>(std::initializer_list<std::pair<int, std::shared_ptr<Base>>> {
  31. { 0, std::make_shared<Derived>() }
  32. }) }
  33. });
  34.  
  35. return 0;
  36. }
Success #stdin #stdout 0s 3424KB
stdin
Standard input is empty
stdout
Standard output is empty