Class vector_index_vector_size (o2scl)

O2scl : Class List

template<class data_t>
class vector_index_vector_size

Index vector with a size method.

This object just returns the index whenever an object in the vector is requested, i.e. operator[](i) always returns i.

Public Functions

inline vector_index_vector_size(size_t n_)

Create an index vector with size n_.

inline data_t operator[](size_t i) const

Obtain the element with index i.

inline size_t size() const

Get the size of the vector.

inline void resize(size_t n_)

Resize the index vector.

Protected Attributes

size_t n

The vector size.