fork download
  1. #include <vector>
  2. template<typename T>
  3. struct node {
  4. void func_ptr_call(void (*visitFunc)()) {
  5. visitFunc();
  6. }
  7.  
  8. std::vector<int> toVector() {
  9. std::vector<int> v;
  10. func_ptr_call([&]() {
  11. v.push_back(0);
  12. });
  13. return v;
  14. }
  15. };
  16.  
  17.  
  18. int main()
  19. {
  20. node<int> n;
  21. n.toVector();
  22. }
Runtime error #stdin #stdout 0s 2892KB
stdin
Standard input is empty
stdout
Standard output is empty