File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -137,18 +137,20 @@ int main()
137137 sll.push_front (0 );
138138
139139 std::cout << " First list: " ;
140- for (auto i : sll)
140+ for (auto i: sll)
141141 std::cout << i << " " ;
142142 std::cout << std::endl;
143143
144144 auto sll2 = sll;
145- std::cout << " Second list after copying from first list: " ;
146- for (auto i : sll2)
147- std::cout << i << " " ; // Prints 0 1 2 3
145+ sll2.push_front (-1 );
146+ std::cout << " Second list after copying from first list and inserting -1 in front: " ;
147+ for (auto i: sll2)
148+ std::cout << i << ' ' ; // Prints -1 0 1 2 3
148149 std::cout << std::endl;
149150
150151 std::cout << " First list after copying - deep copy: " ;
151- for (auto i : sll)
152- std::cout << i << " " ; // Prints 0 1 2 3
152+
153+ for (auto i: sll)
154+ std::cout << i << ' ' ; // Prints 0 1 2 3
153155 std::cout << std::endl;
154156}
You can’t perform that action at this time.
0 commit comments