stl_algobase.h File Reference


Detailed Description

This is an internal header file, included by other library headers. You should not attempt to use it directly.

Definition in file stl_algobase.h.#include <bits/c++config.h>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <cstddef>
#include <iosfwd>
#include <bits/stl_pair.h>
#include <bits/cpp_type_traits.h>
#include <bits/stl_iterator_base_types.h>
#include <bits/stl_iterator_base_funcs.h>
#include <bits/stl_iterator.h>
#include <bits/concept_check.h>
#include <debug/debug.h>

Include dependency graph for stl_algobase.h:

Include dependency graph

Go to the source code of this file.

Namespaces

Defines

Functions


Function Documentation

OutputIterator copy InputIterator  first,
InputIterator  last,
OutputIterator  __result
[inline]
 

Copies the range [first,last) into result.

Parameters:
first An input iterator.
last An input iterator.
result An output iterator.
Returns:
result + (first - last)
This inline function will boil down to a call to memmove whenever possible. Failing that, if random access iterators are passed, then the loop count will be known (and therefore a candidate for compiler optimizations such as unrolling). Result may not be contained within [first,last); the copy_backward function should be used instead.

Note that the end of the output range is permitted to be contained within [first,last). Definition at line 340 of file stl_algobase.h.

Referenced by basic_string::assign(), basic_string::copy(), vector::erase(), deque::erase(), basic_string::insert(), std::merge(), vector::operator=(), deque::operator=(), basic_string::replace(), std::rotate_copy(), std::set_difference(), std::set_symmetric_difference(), and std::set_union().

BI2 copy_backward BI1  first,
BI1  last,
BI2  __result
[inline]
 

Copies the range [first,last) into result.

Parameters:
first A bidirectional iterator.
last A bidirectional iterator.
result A bidirectional iterator.
Returns:
result - (first - last)
The function has the same effect as copy, but starts at the end of the range and works its way to the start, returning the start of the result. This inline function will boil down to a call to memmove whenever possible. Failing that, if random access iterators are passed, then the loop count will be known (and therefore a candidate for compiler optimizations such as unrolling).

Result may not be in the range [first,last). Use copy instead. Note that the start of the output range may overlap [first,last). Definition at line 469 of file stl_algobase.h.

Referenced by deque::erase().

bool equal InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2,
BinaryPredicate  __binary_pred
[inline]
 

Tests a range for element-wise equality.

Parameters:
first1 An input iterator.
last1 An input iterator.
first2 An input iterator.
binary_pred A binary predicate functor.
Returns:
A boolean true or false.
This compares the elements of two ranges using the binary_pred parameter, and returns true or false depending on whether all of the corresponding elements of the ranges are equal. Definition at line 747 of file stl_algobase.h.

bool equal InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2
[inline]
 

Tests a range for element-wise equality.

Parameters:
first1 An input iterator.
last1 An input iterator.
first2 An input iterator.
Returns:
A boolean true or false.
This compares the elements of two ranges using == and returns true or false depending on whether all of the corresponding elements of the ranges are equal. Definition at line 714 of file stl_algobase.h.

Referenced by std::operator==().

void fill ForwardIterator  first,
ForwardIterator  last,
const Type &  value
 

Fills the range [first,last) with copies of value.

Parameters:
first A forward iterator.
last A forward iterator.
value A reference-to-const of arbitrary type.
Returns:
Nothing.
This function fills a range with copies of the same value. For one-byte types filling contiguous areas of memory, this becomes an inline call to memset. Definition at line 525 of file stl_algobase.h.

OutputIterator fill_n OutputIterator  first,
Size  n,
const Type &  value
 

Fills the range [first,first+n) with copies of value.

Parameters:
first An output iterator.
n The count of copies to perform.
value A reference-to-const of arbitrary type.
Returns:
The iterator at first+n.
This function fills a range with copies of the same value. For one-byte types filling contiguous areas of memory, this becomes an inline call to memset. Definition at line 601 of file stl_algobase.h.

void iter_swap ForwardIterator1  a,
ForwardIterator2  __b
[inline]
 

Swaps the contents of two iterators.

Parameters:
a An iterator.
b Another iterator.
Returns:
Nothing.
This function swaps the values pointed to by two iterators, not the iterators themselves. Definition at line 91 of file stl_algobase.h.

Referenced by std::next_permutation(), std::prev_permutation(), std::random_shuffle(), and std::swap_ranges().

bool lexicographical_compare InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2,
InputIterator2  last2,
Compare  comp
 

Performs "dictionary" comparison on ranges.

Parameters:
first1 An input iterator.
last1 An input iterator.
first2 An input iterator.
last2 An input iterator.
comp A comparison functor.
Returns:
A boolean true or false.
The same as the four-parameter lexigraphical_compare, but uses the comp parameter instead of <. Definition at line 817 of file stl_algobase.h.

bool lexicographical_compare InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2,
InputIterator2  last2
 

Performs "dictionary" comparison on ranges.

Parameters:
first1 An input iterator.
last1 An input iterator.
first2 An input iterator.
last2 An input iterator.
Returns:
A boolean true or false.
"Returns true if the sequence of elements defined by the range [first1,last1) is lexicographically less than the sequence of elements defined by the range [first2,last2). Returns false otherwise." (Quoted from [25.3.8]/1.) If the iterators are all character pointers, then this is an inline call to memcmp. Definition at line 778 of file stl_algobase.h.

Referenced by std::operator<().

const Type& max const Type &  a,
const Type &  __b,
Compare  comp
[inline]
 

This does what you think it does.

Parameters:
a A thing of arbitrary type.
b Another thing of arbitrary type.
comp A comparison functor.
Returns:
The greater of the parameters.
This will work on temporary expressions, since they are only evaluated once, unlike a preprocessor macro. Definition at line 213 of file stl_algobase.h.

const Type& max const Type &  a,
const Type &  __b
[inline]
 

This does what you think it does.

Parameters:
a A thing of arbitrary type.
b Another thing of arbitrary type.
Returns:
The greater of the parameters.
This is the simple classic generic implementation. It will work on temporary expressions, since they are only evaluated once, unlike a preprocessor macro. Definition at line 171 of file stl_algobase.h.

const Type& min const Type &  a,
const Type &  __b,
Compare  comp
[inline]
 

This does what you think it does.

Parameters:
a A thing of arbitrary type.
b Another thing of arbitrary type.
comp A comparison functor.
Returns:
The lesser of the parameters.
This will work on temporary expressions, since they are only evaluated once, unlike a preprocessor macro. Definition at line 193 of file stl_algobase.h.

const Type& min const Type &  a,
const Type &  __b
[inline]
 

This does what you think it does.

Parameters:
a A thing of arbitrary type.
b Another thing of arbitrary type.
Returns:
The lesser of the parameters.
This is the simple classic generic implementation. It will work on temporary expressions, since they are only evaluated once, unlike a preprocessor macro. Definition at line 149 of file stl_algobase.h.

Referenced by basic_string::compare(), basic_string< char >::compare(), and basic_string::rfind().

pair<InputIterator1, InputIterator2> mismatch InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2,
BinaryPredicate  __binary_pred
 

Finds the places in ranges which don't match.

Parameters:
first1 An input iterator.
last1 An input iterator.
first2 An input iterator.
binary_pred A binary predicate functor.
Returns:
A pair of iterators pointing to the first mismatch.
This compares the elements of two ranges using the binary_pred parameter, and returns a pair of iterators. The first iterator points into the first range, the second iterator points into the second range, and the elements pointed to by the iterators are not equal. Definition at line 685 of file stl_algobase.h.

pair<InputIterator1, InputIterator2> mismatch InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2
 

Finds the places in ranges which don't match.

Parameters:
first1 An input iterator.
last1 An input iterator.
first2 An input iterator.
Returns:
A pair of iterators pointing to the first mismatch.
This compares the elements of two ranges using == and returns a pair of iterators. The first iterator points into the first range, the second iterator points into the second range, and the elements pointed to by the iterators are not equal. Definition at line 648 of file stl_algobase.h.

void swap Type &  a,
Type &  __b
[inline]
 

Swaps two values.

Parameters:
a A thing of arbitrary type.
b Another thing of arbitrary type.
Returns:
Nothing.
This is the simple classic generic implementation. It will work on any type which has a copy constructor and an assignment operator. Definition at line 124 of file stl_algobase.h.


Generated on Sun Sep 12 15:50:03 2004 for libstdc++ source by doxygen 1.3.8