#include #include #include #include using namespace std; int main() { list li1; //born empty, but we can insert int's later list li2(3); //born containing 0, 0, 0 list li3(3, 10); //born containing 10, 10, 10 const int a[] = {10, 20, 30}; const size_t n = sizeof a / sizeof a[0]; list li4(a, a + n); //born containing 10, 20, 30 vector v(a, a + n); //born containing 10, 20, 30 list li5(v.begin(), v.end()); //born containing 10, 20, 30 list li6 = li5; //born containing 10, 20, 30: copy constructor for (list::const_iterator it = li6.begin(); it != li6.end(); ++it) { cout << *it << "\n"; } return EXIT_SUCCESS; }