Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 390 Bytes

emplace_back.md

File metadata and controls

18 lines (13 loc) · 390 Bytes

emplace_back

Description : emplace_back() function is used to add an element to the end of the list

Example:

    std::list<int> mylist;

    mylist.emplace_back(1);
    mylist.emplace_back(2);
    mylist.emplace_back(3);

    std::cout << "mylist contains: ";
    for (auto& x: mylist)
        std::cout << x << " ";
 

Run Code