STL Learning Series II: Standard Template Library (STL) Introduction

Source: Internet
Author: User

This article for the post, because the original operation in Linux, I under the Vc6/7 debugging, made a partial modification! Note: All code is debugged under VC6/VC7! Standard Template Library (STL) Introduction

Standard Template Library (STL) Introduction

0 preface.

1 Define a list

2 Insert an element into the list using the member functions of the list push_back and Push_front

member functions of the 3 list empty ()

4 using a For loop to work with the elements in the list

5 using STL general algorithm For_each to deal with the elements in the list

6 using STL Universal Algorithm count_if () to count the number of elements in the list

7 A more complex function object using Count_if ().

8 using STL General algorithm find () Look up objects in list

9 using STL General Algorithm find_if () search for objects in list

10 using STL General algorithm search find a sequence in the list

11 use the member function of the list to sort () Order a list.

12 insert element into list with member function of list

The List constructor

14 using the list member function to remove elements from the list

15 Remove the element from the list using the list member function remove ().

16 Use STL General algorithm remove () delete element from list

17 Use STL General Algorithm stable_partition () and list member function splice () to divide a list

18 Conclusion

Using STL in Field

19 Bibliography:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.