fork download
  1. #include <string>
  2. #include <list>
  3. #include<iostream>
  4.  
  5. using namespace std;
  6.  
  7. int main(int argc, const char * argv[])
  8. {
  9. list<int> l{1,2,3,4};
  10. list<list<int>> ll;
  11. ll.push_back(l);
  12.  
  13. for(auto x:ll)
  14. for(auto y:x)
  15. std::cout<< y << " ";
  16.  
  17. std::cout << "\nSize :" << ll.size();
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
1 2 3 4 
Size :1