SourceForge Logo Tiny Vector Matrix library using Expression Templates Sourceforge Project Page

tvmet::util::Incrementor< T > Class Template Reference

#include <tvmet/util/Incrementor.h>

Collaboration diagram for tvmet::util::Incrementor< T >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class T>
class tvmet::util::Incrementor< T >

A simple incrementor class.

The start value is given at construction time. After each access the class increments the internal counter.

Example:
 #include <algorithm>

 using namespace tvmet;

 ...

 std::generate(m1.begin(), m1.end(),
 util::Incrementor<typename matrix_type::value_type>());


Public Member Functions

 Incrementor (T start=0)
operator() ()

Private Attributes

m_inc


Constructor & Destructor Documentation

template<class T>
tvmet::util::Incrementor< T >::Incrementor ( start = 0  )  [inline]


Member Function Documentation

template<class T>
T tvmet::util::Incrementor< T >::operator() (  )  [inline]


Member Data Documentation

template<class T>
T tvmet::util::Incrementor< T >::m_inc [private]


Author: