Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Rogue Wave C++ Standard Library Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

includes()

Module:  Standard C++ Library   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

Copyright (c) 1994-2006 Rogue Wave Software, a Quovadx Division.
Licensed under the Apache License, Version 2.0.
Contact Rogue Wave about documentation or support issues. You can also seek help from other developers through the Apache stdcxx community (see below).

For more information on the Rogue Wave Standard C++ Library under open source, see Section 1.2 of the user's guide.