C + + list Merge list

Source: Internet
Author: User

1. Reference

http://www.cplusplus.com/reference/list/list/

2. Merging

There are two main functions: Splice () and merge ()
Splice () has three forms of invocation:
The first type: List1.splice (it1, list2). Copies all the elements in the List2 to List1. The starting position in List1 is it1. After the copy is finished, List2 will be empty.


The second form of invocation:
List1.splice (it1, List2, it2)
This function is to list2 the elements in the it2, starting at the beginning of the List1, and cutting to the place where the it1 start.
The third form of invocation:
List1.splice (it1, List2, It2begin, It2end)
Use of the merge function:
Form: List1.merge (LIST2)
Note: Before you use merge, you must make List1 and list2 in order. Also, the list1 is still orderly after the merger.

C + + list Merge list

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.