Vector< T > Class Template Reference

Mimics std::vector<T> More...

#include "Vector.hpp"


class  Iterator
 A random access iterator class for Vector. More...

Public Types

template<class ForX , class ForBool >
using ForXOrBool = typename std::conditional<!std::is_same< T, bool >::value, ForX, ForBool >::type
using iterator = Iterator< false, true >
using const_iterator = Iterator< true, true >
using reverse_iterator = Iterator< false, false >
using const_reverse_iterator = Iterator< true, false >
using value_type = T
using size_type = std::size_t
using difference_type = std::ptrdiff_t
using reference = ForXOrBool< T &, BoolReference >
using const_reference = ForXOrBool< T const &, bool >
using pointer = ForXOrBool< T *, iterator >
using const_pointer = ForXOrBool< T const *, const_iterator >

Public Member Functions

construction / destruction
 Vector ()
 Vector (size_type n)
 Vector (size_type n, const T &value)
 Vector (const Vector &that)
 Vector (Vector &&that)
 Vector (iterator beg, iterator end)
 Vector (const_iterator beg, const_iterator end)
 Vector (reverse_iterator beg, reverse_iterator end)
 Vector (const_reverse_iterator beg, const_reverse_iterator end)
 ~Vector ()
assignment, swapping
Vectoroperator= (const Vector &that)
Vectoroperator= (Vector &&that)
void assign (size_type count, const T &value)
void assign (iterator beg, iterator end)
void assign (const_iterator beg, const_iterator end)
void assign (reverse_iterator beg, reverse_iterator end)
void assign (const_reverse_iterator beg, const_reverse_iterator end)
void swap (Vector &that)
iterator traversal

forward/reverse, const/non-const

iterator begin () noexcept
iterator end () noexcept
const_iterator begin () const noexcept
const_iterator end () const noexcept
const_iterator cbegin () const noexcept
const_iterator cend () const noexcept
reverse_iterator rbegin () noexcept
reverse_iterator rend () noexcept
const_reverse_iterator rbegin () const noexcept
const_reverse_iterator rend () const noexcept
const_reverse_iterator crbegin () const noexcept
const_reverse_iterator crend () const noexcept
element access
reference at (size_type pos)
const_reference at (size_type pos) const
reference operator[] (size_type n)
const_reference operator[] (size_type n) const
reference front ()
reference back ()
const_reference front () const
const_reference back () const
size_type size () const noexcept
size_type max_size () const noexcept
size_type capacity () const noexcept
bool empty () const noexcept
void shrink_to_fit ()
void clear () noexcept
void resize (size_type n, T value=T())
void reserve (size_type n)
void push_back (const T &val)
iterator insert (const_iterator pos, const T &value)
iterator insert (const_iterator pos, size_type n, const T &value)
iterator insert (const_iterator pos, iterator beg, iterator end)
iterator insert (const_iterator pos, const_iterator beg, const_iterator end)
iterator insert (const_iterator pos, reverse_iterator beg, reverse_iterator end)
iterator insert (const_iterator pos, const_reverse_iterator beg, const_reverse_iterator end)
void pop_back ()
iterator erase (const_iterator pos)
iterator erase (const_iterator beg, const_iterator end)

Detailed Description

template<class T>
class opals::Vector< T >

Mimics std::vector<T>

Template Parameters
Tthe element type

Symbols for Vector are exported to opals DLLs as required by their modules' interfaces, meaning that DLL users are able to instantiate Vector<T> only with the corresponding template arguments. The interface of opals::Vector differs slightly from std::vector: no template constructors, no template functions are provided, but these are represented as non-template overloads for Vector::iterator, Vector::const_iterator, Vector::reverse_iterator, and Vector::const_reverse_iterator.