SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
The const
random access iterator for the RWMathVec<T> collection class.
More...
#include <rw/math/mathvec.h>
Public Member Functions | |
RWMathVecConstIterator () | |
RWMathVecConstIterator (const RWMathVecConstIterator< T > &x) | |
RWMathVecConstIterator (const RWMathVecIterator< T > &x) | |
RWMathVecConstIterator< T > & | operator++ () |
RWMathVecConstIterator< T > & | operator-- () |
RWMathVecConstIterator< T > | operator++ (int) |
RWMathVecConstIterator< T > | operator-- (int) |
difference_type | operator- (const RWMathVecIteratorBase< T > &i) const |
RWMathVecConstIterator< T > & | operator+= (difference_type d) |
RWMathVecConstIterator< T > & | operator-= (difference_type d) |
RWMathVecConstIterator< T > | operator- (difference_type d) const |
RWMathVecConstIterator< T > | operator+ (difference_type d) const |
const value_type & | operator[] (difference_type n) const |
const value_type & | operator* () const |
const_pointer | operator-> () const |
Class RWMathVecConstIterator<T> is the const
random access iterator for the RWMathVec<T> collection class. The RWMathVecConstIterator<T> class behaves like a pointer to type T
and is used to increment through elements of an RWMathVec<T> . The RWMathVecConstIterator<T> differs from RWMathVecIterator<T> in that the value in a dereferenced RWMathVecConstIterator<T> may not be changed.
#include <rw/math/mathvec.h> int main() { RWMathVec<int> V(5,1); // Create a length 5 vector of 1's RWMathVec<int>::const_iterator i = V.begin(); RWMathVec<int>::const_iterator stop = V.end(); // Print each element of V while(i != stop) { cout << *i << endl; ++i; } }
RWMathVecConstIterator< T >::RWMathVecConstIterator | ( | ) | [inline] |
Constructs a RWMathVecConstIterator<T> that is in an uninitialized state. The RWMathVecConstIterator<T> must be initialized before it is dereferenced.
RWMathVecConstIterator< T >::RWMathVecConstIterator | ( | const RWMathVecConstIterator< T > & | x | ) | [inline] |
Constructs a RWMathVecConstIterator<T> from another RWMathVecConstIterator<T> . Initialized RWMathVecConstIterator<T> can be obtained via the RWMathVec<T>::begin() and RWMathVec<T>::end().
RWMathVecConstIterator< T >::RWMathVecConstIterator | ( | const RWMathVecIterator< T > & | x | ) | [inline] |
Constructs a RWMathVecConstIterator<T> from another RWMathVecIterator<T> . Initialized RWMathVecIterator<T> can be obtained via the RWMathVec<T>::begin() and RWMathVec<T>::end().
const value_type& RWMathVecConstIterator< T >::operator* | ( | ) | const [inline] |
Returns a reference to the element pointed to by self.
RWMathVecConstIterator<T> RWMathVecConstIterator< T >::operator+ | ( | difference_type | d | ) | const [inline] |
Returns a RWMathVecConstIterator<T> that is d elements past self.
RWMathVecConstIterator<T> RWMathVecConstIterator< T >::operator++ | ( | int | ) | [inline] |
Prefix or postfix increment or decrement operator. The RWMathVecConstIterator<T> points to the next or previous element in the RWMathVec<T> . No error condition is set if the RWMathVecConstIterator<T> goes past the bounds of the vector. Compare to RWMathVec<T>::begin() and RWMathVec<T>::end() to check that the RWMathVecConstIterator<T> position is valid.
RWMathVecConstIterator<T>& RWMathVecConstIterator< T >::operator++ | ( | ) | [inline] |
Prefix or postfix increment or decrement operator. The RWMathVecConstIterator<T> points to the next or previous element in the RWMathVec<T> . No error condition is set if the RWMathVecConstIterator<T> goes past the bounds of the vector. Compare to RWMathVec<T>::begin() and RWMathVec<T>::end() to check that the RWMathVecConstIterator<T> position is valid.
RWMathVecConstIterator<T>& RWMathVecConstIterator< T >::operator+= | ( | difference_type | d | ) | [inline] |
Moves the RWMathVecConstIterator<T> forward or backward d elements in the RWMathVec<T> . No error condition is set if the RWMathVecConstIterator<T> goes past the bounds of the vector. Incrementing by d and then decrementing by d returns the RWMathVecConstIterator<T> to its original position, even if doing so takes it past the bounds of the vector.
RWMathVecConstIterator<T> RWMathVecConstIterator< T >::operator- | ( | difference_type | d | ) | const [inline] |
Returns a RWMathVecConstIterator<T> that is d elements before self.
difference_type RWMathVecConstIterator< T >::operator- | ( | const RWMathVecIteratorBase< T > & | i | ) | const [inline] |
If the return value is positive, sets the RWMathVecConstIterator<T> that many elements past the RWMathVecConstIterator<T> i. If the return value is negative, sets the RWMathVecConstIterator<T> that many elements before the RWMathVecConstIterator<T> i.
RWMathVecConstIterator<T> RWMathVecConstIterator< T >::operator-- | ( | int | ) | [inline] |
Prefix or postfix increment or decrement operator. The RWMathVecConstIterator<T> points to the next or previous element in the RWMathVec<T> . No error condition is set if the RWMathVecConstIterator<T> goes past the bounds of the vector. Compare to RWMathVec<T>::begin() and RWMathVec<T>::end() to check that the RWMathVecConstIterator<T> position is valid.
RWMathVecConstIterator<T>& RWMathVecConstIterator< T >::operator-- | ( | ) | [inline] |
Prefix or postfix increment or decrement operator. The RWMathVecConstIterator<T> points to the next or previous element in the RWMathVec<T> . No error condition is set if the RWMathVecConstIterator<T> goes past the bounds of the vector. Compare to RWMathVec<T>::begin() and RWMathVec<T>::end() to check that the RWMathVecConstIterator<T> position is valid.
RWMathVecConstIterator<T>& RWMathVecConstIterator< T >::operator-= | ( | difference_type | d | ) | [inline] |
Moves the RWMathVecConstIterator<T> forward or backward d elements in the RWMathVec<T> . No error condition is set if the RWMathVecConstIterator<T> goes past the bounds of the vector. Incrementing by d and then decrementing by d returns the RWMathVecConstIterator<T> to its original position, even if doing so takes it past the bounds of the vector.
const_pointer RWMathVecConstIterator< T >::operator-> | ( | ) | const [inline] |
For iterator a, and identifier m, a->m is equivalent to (*a).m.
const value_type& RWMathVecConstIterator< T >::operator[] | ( | difference_type | n | ) | const [inline] |
Returns a reference to the element n elements after self if n is positive, or n elements before self if n is negative.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.