Useful Functions
The global functions std::begin, std::end, std::prev, std::next, std::distance
and std::advance
make your handling of the iterators a lot easier. Only the function std::prev
requires a bidirectional iterator. All functions need the header <iterator>
. The table gives you the overview.
Global function | Description |
---|---|
std::begin(cont) |
Returns a begin iterator to the container cont . |
std::end(cont) |
Returns an end iterator to the container cont . |
std::rbegin(cont) |
Returns a reverse begin iterator to the container cont . |
std::rend(cont) |
Returns a reverse end iterator to the container cont . |
std::cbegin(cont) |
Returns a constant begin iterator to the container cont . |
std::cend(cont) |
Returns a constant end iterator to the container cont . |
std... |