stl:algorithm:includes

C++ Reference

includes

Syntax:

    #include <algorithm>
    bool includes( iterator start1, iterator end1, iterator start2, iterator end2 );
    bool includes( iterator start1, iterator end1, iterator start2, iterator end2, StrictWeakOrdering cmp );

The includes() algorithm returns true if every element in [start2,end2) is also in [start1,end1). Both of the given ranges must be sorted in ascending order and must not contain duplicate elements.

By default, the < operator is used to compare elements. If the strict weak ordering function object cmp is given, then it is used instead.

includes() runs in linear time.

Related Topics: set_difference, set_intersection, set_symmetric_difference, set_union