scale_iterator<RandomAccessIterator, T> [MTL Home] Programmers Guide
  Contents | Index |  Search 


Category:iterators,adaptors Component type:type
Description
The scale iterator is an adaptor which multiplies the value of the underlying element by some scalar as they are access (through the dereference operator). Scale iterators are somewhat different from most in that they are always considered to be a constant iterator whether or not the underlying elements are mutable. Typically users will not need to use scale iterator directly. It is really just an implementation detail of the scaled1D container.
Example
Definition
scale_iterator.h
Template Parameters

ParameterDescriptionDefault
RandomAccessIteratorThe underlying iterator 
TThe type of the scalar to multiply by 
Model of
RandomAccessIterator
Type requirements
  • T must be convertible to RandomAccessIterator's value_type
  • RandomAccessIterator's value_type must be a model of Ring
Members
Member Where defined Description
value_type   The value type
difference_type   The difference type
pointer   The pointer type
distance_type    
pointer   The pointer type
iterator_category   The iterator category
Distance    
iterator_type    
reference   The reference type
const_reference    
scale_iterator () Trivial Iterator The default constructor
scale_iterator (const RandomAccessIterator& x) scale_iterator  
scale_iterator (const RandomAccessIterator& x, const value_type& a) scale_iterator Normal constructor
scale_iterator (const self& x) Trivial Iterator Copy constructor
int index () const Indexible Iterator MTL index method
operator RandomAccessIterator () scale_iterator Convert to base iterator
RandomAccessIterator base () const scale_iterator Access base iterator
value_type operator* () const Trivial Iterator Dereference (and scale)
self& operator () Forward Iterator Preincrement
self operator (int) Forward Iterator Postincrement
self& operator-- () Bidirectional Iterator Preincrement
self operator-- (int) Bidirectional Iterator Postincrement
self operator+ (Distance n) const Random Access Iterator Iterator addition
self& operator+= (Distance n) Random Access Iterator Advance a distance
self operator- (Distance n) const Random Access Iterator Subtract a distance
difference_type operator- (const self& x) const    
self& operator-= (Distance n) Random Access Iterator Retreat a distance
value_type operator[] (Distance n) const   Access at an offset
bool operator== (const self& x) const Trivial Iterator Equality
bool operator!= (const self& x) const Trivial Iterator Inequality
bool operator< (const self& x) const Random Access Iterator Less than
New members
Notes
See also

[MTL Home] Copyright © 1998,1999 University of Notre Dame. All Rights Reserved.