Previous fileTop of DocumentContentsIndex pageNext file
Apache C++ Standard Library Reference Guide

includes()

Library:  Algorithms


Function

Local Index

No Entries

Summary

An algorithm that returns true if every element in one sorted sequence is contained in another sorted sequence

Synopsis

#include <algorithm>

namespace std {
  template <class InputIterator1, class InputIterator2>
  bool includes(InputIterator1 start1, InputIterator1 finish1,
                InputIterator2 start2, 
                InputIterator2 finish2);

  template <class InputIterator1, class InputIterator2, 
           class Compare>
  bool includes(InputIterator1 start1, InputIterator1 finish1,
                InputIterator2 start2, 
                InputIterator2 finish2, Compare comp);
}

Description

The includes() algorithm compares two sorted sequences and returns true if every element in the range [start2, finish2) is contained in the range [start1, finish1). It returns false otherwise. includes() assumes that the sequences are sorted using operator<(), or using the predicate comp.

Complexity

At most ((finish1 - start1) + (finish2 - start2)) * 2 - 1 comparisons are performed.

Example

See Also

set_union(), set_intersection(), set_difference(), set_symmetric_difference()

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Section 25.3.5.1



Previous fileTop of DocumentContentsIndex pageNext file