Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

Searching Algorithms
[Algorithms]


Functions

template<typename InputIterator, typename EqualityComparable>
InputIterator ustl::find (InputIterator first, InputIterator last, const EqualityComparable &value)
template<typename ForwardIterator>
ForwardIterator ustl::adjacent_find (ForwardIterator first, ForwardIterator last)
template<typename InputIterator>
pair< InputIterator, InputIterator > ustl::mismatch (InputIterator first1, InputIterator last1, InputIterator first2)
template<typename InputIterator>
bool ustl::equal (InputIterator first1, InputIterator last1, InputIterator first2)
 Returns true if two ranges are equal. This is an extension, present in uSTL and SGI STL.
template<typename InputIterator, typename EqualityComparable>
size_t ustl::count (InputIterator first, InputIterator last, const EqualityComparable &value)
template<typename ForwardIterator, typename LessThanComparable>
ForwardIterator ustl::lower_bound (ForwardIterator first, ForwardIterator last, const LessThanComparable &value)
template<typename ForwardIterator, typename LessThanComparable>
ForwardIterator ustl::binary_search (ForwardIterator first, ForwardIterator last, const LessThanComparable &value)
template<typename ForwardIterator, typename LessThanComparable>
ForwardIterator ustl::upper_bound (ForwardIterator first, ForwardIterator last, const LessThanComparable &value)
template<typename ForwardIterator, typename LessThanComparable>
pair< ForwardIterator, ForwardIterator > ustl::equal_range (ForwardIterator first, ForwardIterator last, const LessThanComparable &value)

Detailed Description

Algorithms for searching through containers.

Function Documentation

template<typename ForwardIterator>
ForwardIterator adjacent_find ForwardIterator  first,
ForwardIterator  last
[inline]
 

Returns the first iterator such that *i == *(i + 1)

template<typename ForwardIterator, typename LessThanComparable>
ForwardIterator binary_search ForwardIterator  first,
ForwardIterator  last,
const LessThanComparable &  value
[inline]
 

Performs a binary search inside the sorted range.

template<typename InputIterator, typename EqualityComparable>
size_t count InputIterator  first,
InputIterator  last,
const EqualityComparable &  value
[inline]
 

Count finds the number of elements in [first, last) that are equal to value. More precisely, the first version of count returns the number of iterators i in [first, last) such that *i == value.

template<typename ForwardIterator, typename LessThanComparable>
pair<ForwardIterator,ForwardIterator> equal_range ForwardIterator  first,
ForwardIterator  last,
const LessThanComparable &  value
[inline]
 

Returns pair<lower_bound,upper_bound>

template<typename InputIterator, typename EqualityComparable>
InputIterator find InputIterator  first,
InputIterator  last,
const EqualityComparable &  value
[inline]
 

Returns the first iterator i in the range [first, last) such that i == value. Returns last if no such iterator exists.

template<typename ForwardIterator, typename LessThanComparable>
ForwardIterator lower_bound ForwardIterator  first,
ForwardIterator  last,
const LessThanComparable &  value
[inline]
 

Returns the furthermost iterator i in [first, last) such that, for every iterator j in [first, i), *j < value Assumes the range is sorted.

template<typename InputIterator>
pair<InputIterator,InputIterator> mismatch InputIterator  first1,
InputIterator  last1,
InputIterator  first2
[inline]
 

Returns the pointer to the first pair of unequal elements.

template<typename ForwardIterator, typename LessThanComparable>
ForwardIterator upper_bound ForwardIterator  first,
ForwardIterator  last,
const LessThanComparable &  value
[inline]
 

Returns the furthermost iterator i in [first,last) such that for every iterator j in [first,i), value < *j is false.


Generated on Mon Jan 17 14:35:02 2005 for uSTL by 1.3.9 Doxygen Hosted on SourceForge.net