NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Vector Views

This module implements a vector adaptor, which allows to create an "std::vector"-like container on top of a base iterator.

Example

// build a vector_view out of a static array
typedef vector_view<uint32*> vector_type;
uint32 storage[16];
vector_type vector( 0, storage );
// use push_back()
vector.push_back( 3 );
vector.push_back( 7 );
vector.push_back( 11 );
// use resize()
vector.resize( 4 );
// use the indexing operator[]
vector[3] = 8;
// use the begin() / end() iterators
std::sort( vector.begin(), vector.end() );
// use front() and back()
printf("(%u, %u)\n"); // -> (3,11)