fork(3) download
  1. #include <iostream>
  2. #include <forward_list>
  3.  
  4. using namespace std;
  5.  
  6. struct Node
  7. {
  8. double x;
  9. double y;
  10. };
  11.  
  12. int main()
  13. {
  14. forward_list<Node> myList;
  15. myList.push_front({3.14, 2.71});
  16. myList.push_front(Node{3.14, 2.71});
  17. Node n;
  18. n.x = 3.14;
  19. n.y = 2.71;
  20. myList.push_front(n);
  21. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
Standard output is empty