Concept RandomAccessIteratorConceptAn iterator allowing random access.
An iterator allowing random access.
Extends | BidirectionalIteratorConcept, LessThanComparableConcept |
---|---|
All Extended | BidirectionalIteratorConcept, CopyConstructibleConcept, DefaultConstructibleConcept, EqualityComparableConcept, ForwardIteratorConcept, InputIteratorConcept, IteratorAssociatedTypesConcept, LessThanComparableConcept |
All Subcl's | MutableRandomAccessIteratorConcept, MutableRootedRandomAccessIteratorConcept, RootedRandomAccessIteratorConcept |
Defined in | <seqan/basic.h> |
Signature |
RandomAccessIteratorConcept<T>
|
Detailed Description
This function is equivalent to --iterator.
Examples
In the following, x is an iterator to type X, t is a valid rvalue of type X, n is a distance type.
The following expressions must be valid.
x += n // Iterator addition assignment.
x + n // Iterator addition.
n + i // Iterator addition.
x -= n // Iterator subtraction assignment.
x - n // Iterator subtraction.
x - a // Difference.
x[n] // Element operator.
Member Function Overview
-
TReference TIterator::operator[](pos);
C++ built-in array subscript operator.
Member Functions Inherited From EqualityComparableConcept
Member Functions Inherited From LessThanComparableConcept
Interface Function Overview
-
bool atNil(it);
Tests whether iterator is at nil position. -
TDifference difference(begin, end);
The difference between two iterators. -
void goFurther(iterator, steps);
Iterates some steps further. -
void goNil(it);
Moves iterator to nil position. -
TIterator operator+(lhs, rhs);
C++ built-in addition operator. -
TIterator operator+=(it, diff);
C++ built-in addition assignment operator. -
TIterator operator-=(it, diff);
C++ built-in subtraction assignment operator.
Interface Functions Inherited From BidirectionalIteratorConcept
Interface Functions Inherited From InputIteratorConcept
Interface Functions Inherited From IteratorAssociatedTypesConcept
Interface Metafunction Overview
-
Difference<T>::Type
Type of an object that stores the difference between two iterators.
Interface Metafunctions Inherited From IteratorAssociatedTypesConcept
Member Functions Detail
TReference TIterator::operator[](pos);
C++ built-in array subscript operator.
Template Parameters
TReference |
The referenced element. |
---|
Parameters
pos
|
Position to get element at. |
---|
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
Interface Functions Detail
bool atNil(it);
Tests whether iterator is at nil position.
Parameters
it
|
The iterator to query. |
---|
Returns
bool |
Whether or not the iterator is at the nil positions (NULL for pointers). |
---|
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
TDifference difference(begin, end);
The difference between two iterators.
Parameters
begin
|
Iterator to the first position of a range. |
---|---|
end
|
Iterator behind the last position of a range. |
Returns
TDifference |
Length of the range between begin and end, type from |
---|
This function is equivalent to end - begin.
Usually, begin and end have the same type.
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
void goFurther(iterator, steps);
Iterates some steps further.
Parameters
it
|
The iterator to move. |
---|---|
steps
|
Number of steps iterator should be moved further. |
This function is equivalent to iterator += steps.
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
void goNil(it);
Moves iterator to nil position.
Parameters
it
|
The iterator that will be moved. |
---|
it is set to an invalid position, e.g. NULL for pointer types.
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
TIterator operator+(lhs, rhs);
C++ built-in addition operator.
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
TIterator operator+=(it, diff);
C++ built-in addition assignment operator.
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
TIterator operator-=(it, diff);
C++ built-in subtraction assignment operator.
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.