includes [C++ Reference]
Keywords: stl,algorithm,includes
Date: 2009-07-15T10:27:12-0700

[[includes]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## includes

Syntax:

        #include <algorithm>

        template< typename InIterA, typename InIterB >
        bool includes( InIterA start1, InIterA end1, InIterB start2, InIterB end2 );

        template< typename InIterA, typename InIterB, typename StrictWeakOrdering >
        bool includes( InIterA start1, InIterA end1, InIterB start2, InIterB 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

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •