utilities  0.0
Classes | Public Types | Public Member Functions | Friends | List of all members
molpro::vector< T, _Alloc > Class Template Reference

#include <memory.h>

Classes

class  MyIterator
 

Public Types

using Iterator = MyIterator< false >
 
using ConstIterator = MyIterator< true >
 
typedef Iterator iterator
 
typedef ConstIterator const_iterator
 
using reverse_iterator = std::reverse_iterator< Iterator >
 
using const_reverse_iterator = std::reverse_iterator< ConstIterator >
 

Public Member Functions

 vector (size_t const length=0)
 Construct a vector of type T with managed storage. More...
 
 vector (size_t const length, const T &value)
 Construct a vector of type T with managed storage. More...
 
template<class InputIterator >
 vector (InputIterator first, InputIterator last)
 Construct a vector of type T with managed storage. More...
 
 vector (std::initializer_list< T > il)
 Construct a vector of type T with managed storage. More...
 
 vector (const vector< T, _Alloc > &source)
 vector<T> Copy constructor More...
 
vector< T, _Alloc > & operator= (const vector< T, _Alloc > &copy)
 Copy assignment operator. More...
 
virtual ~vector ()=default
 
T & operator[] (size_t n)
 
const T & operator[] (size_t n) const
 
template<class InputIterator >
void assign (InputIterator first, InputIterator last)
 Assign new contents to the vector, replacing its current contents. More...
 
void assign (const T &value)
 Assign new contents to the vector, replacing its current contents. More...
 
void assign (size_t n, const T &value)
 Assign new contents to the vector, replacing its current contents. More...
 
void assign (std::initializer_list< T > il)
 Assign new contents to the vector, replacing its current contents. More...
 
T & at (size_t n)
 
const T & at (size_t n) const
 
T & back () noexcept
 
const T & back () const noexcept
 
size_t capacity () const noexcept
 
void clear () noexcept
 
bool empty () const noexcept
 
T & front () noexcept
 
const T & front () const noexcept
 
T * data () noexcept
 
const T * data () const noexcept
 
size_t max_size () const noexcept
 
size_t size () const noexcept
 
void swap (vector< T, _Alloc > &x)
 Exchange the content of the container by the content of x, which is another object of the same type. More...
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
const_iterator cbegin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cend () const noexcept
 
reverse_iterator rbegin () noexcept
 
const_reverse_iterator rbegin () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
reverse_iterator rend () noexcept
 
const_reverse_iterator rend () const noexcept
 
const_reverse_iterator crend () const noexcept
 
iterator erase (const_iterator pos)
 
iterator erase (const_iterator first, const_iterator last)
 
std::string str (int verbosity=1, unsigned int columns=UINT_MAX) const
 Generate a printable representation of the object. More...
 
void reserve (size_t new_cap)
 
void resize (size_t n)
 Resize the buffer. More...
 
void resize (size_t n, const T &val)
 Resize the buffer, and assign a value to any new elements if it grows. More...
 
void shrink_to_fit ()
 
void pop_back ()
 
void push_back (const T &value)
 
void push_back (T &&value)
 
template<class... Args>
void emplace_back (Args &&... args)
 
template<class... Args>
iterator emplace (const_iterator pos, Args &&... args)
 

Friends

void swap (vector< T, _Alloc > &a, vector< T, _Alloc > &b)
 

Member Typedef Documentation

◆ const_iterator

template<typename T = double, typename _Alloc = molpro::allocator<T>>
typedef ConstIterator molpro::vector< T, _Alloc >::const_iterator

◆ const_reverse_iterator

template<typename T = double, typename _Alloc = molpro::allocator<T>>
using molpro::vector< T, _Alloc >::const_reverse_iterator = std::reverse_iterator<ConstIterator>

◆ ConstIterator

template<typename T = double, typename _Alloc = molpro::allocator<T>>
using molpro::vector< T, _Alloc >::ConstIterator = MyIterator<true>

◆ Iterator

template<typename T = double, typename _Alloc = molpro::allocator<T>>
using molpro::vector< T, _Alloc >::Iterator = MyIterator<false>

◆ iterator

template<typename T = double, typename _Alloc = molpro::allocator<T>>
typedef Iterator molpro::vector< T, _Alloc >::iterator

◆ reverse_iterator

template<typename T = double, typename _Alloc = molpro::allocator<T>>
using molpro::vector< T, _Alloc >::reverse_iterator = std::reverse_iterator<Iterator>

Constructor & Destructor Documentation

◆ vector() [1/5]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
molpro::vector< T, _Alloc >::vector ( size_t const  length = 0)
inline

Construct a vector of type T with managed storage.

Parameters
lengthThe number of elements of buffer.

◆ vector() [2/5]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
molpro::vector< T, _Alloc >::vector ( size_t const  length,
const T &  value 
)
inline

Construct a vector of type T with managed storage.

Parameters
lengthThe number of elements of buffer.
valueThe value to assign to all elements of the buffer.

◆ vector() [3/5]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
template<class InputIterator >
molpro::vector< T, _Alloc >::vector ( InputIterator  first,
InputIterator  last 
)
inline

Construct a vector of type T with managed storage.

Parameters
firstStarting iterator of vector to copy
lastEnding iterator of vector to copy

◆ vector() [4/5]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
molpro::vector< T, _Alloc >::vector ( std::initializer_list< T >  il)
inline

Construct a vector of type T with managed storage.

Parameters
ilInitializer list

◆ vector() [5/5]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
molpro::vector< T, _Alloc >::vector ( const vector< T, _Alloc > &  source)
inline

vector<T> Copy constructor

Parameters
sourceAn existing object. An element-by-element copy is made, i.e. the data buffer is allocated then copied from source.

◆ ~vector()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
virtual molpro::vector< T, _Alloc >::~vector ( )
virtualdefault

Member Function Documentation

◆ assign() [1/4]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
void molpro::vector< T, _Alloc >::assign ( const T &  value)
inline

Assign new contents to the vector, replacing its current contents.

Parameters
valueThe value to set all elements of the vector to.

◆ assign() [2/4]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
template<class InputIterator >
void molpro::vector< T, _Alloc >::assign ( InputIterator  first,
InputIterator  last 
)
inline

Assign new contents to the vector, replacing its current contents.

Parameters
firstStarting iterator of vector to copy
lastEnding iterator of vector to copy

◆ assign() [3/4]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
void molpro::vector< T, _Alloc >::assign ( size_t  n,
const T &  value 
)
inline

Assign new contents to the vector, replacing its current contents.

Parameters
nThe new number of elements
valueThe value to set all elements of the vector to.

◆ assign() [4/4]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
void molpro::vector< T, _Alloc >::assign ( std::initializer_list< T >  il)
inline

Assign new contents to the vector, replacing its current contents.

Parameters
ilAn initializer. The vector is resized to match the length of il.

◆ at() [1/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
T& molpro::vector< T, _Alloc >::at ( size_t  n)
inline

◆ at() [2/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
const T& molpro::vector< T, _Alloc >::at ( size_t  n) const
inline

◆ back() [1/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
const T& molpro::vector< T, _Alloc >::back ( ) const
inlinenoexcept

◆ back() [2/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
T& molpro::vector< T, _Alloc >::back ( )
inlinenoexcept

◆ begin() [1/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
const_iterator molpro::vector< T, _Alloc >::begin ( ) const
inlinenoexcept

◆ begin() [2/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
iterator molpro::vector< T, _Alloc >::begin ( )
inlinenoexcept

◆ capacity()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
size_t molpro::vector< T, _Alloc >::capacity ( ) const
inlinenoexcept

◆ cbegin()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
const_iterator molpro::vector< T, _Alloc >::cbegin ( ) const
inlinenoexcept

◆ cend()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
const_iterator molpro::vector< T, _Alloc >::cend ( ) const
inlinenoexcept

◆ clear()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
void molpro::vector< T, _Alloc >::clear ( )
inlinenoexcept

◆ crbegin()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
const_reverse_iterator molpro::vector< T, _Alloc >::crbegin ( ) const
inlinenoexcept

◆ crend()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
const_reverse_iterator molpro::vector< T, _Alloc >::crend ( ) const
inlinenoexcept

◆ data() [1/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
const T* molpro::vector< T, _Alloc >::data ( ) const
inlinenoexcept

◆ data() [2/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
T* molpro::vector< T, _Alloc >::data ( )
inlinenoexcept

◆ emplace()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
template<class... Args>
iterator molpro::vector< T, _Alloc >::emplace ( const_iterator  pos,
Args &&...  args 
)
inline

◆ emplace_back()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
template<class... Args>
void molpro::vector< T, _Alloc >::emplace_back ( Args &&...  args)
inline

◆ empty()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
bool molpro::vector< T, _Alloc >::empty ( ) const
inlinenoexcept

◆ end() [1/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
const_iterator molpro::vector< T, _Alloc >::end ( ) const
inlinenoexcept

◆ end() [2/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
iterator molpro::vector< T, _Alloc >::end ( )
inlinenoexcept

◆ erase() [1/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
iterator molpro::vector< T, _Alloc >::erase ( const_iterator  first,
const_iterator  last 
)
inline

◆ erase() [2/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
iterator molpro::vector< T, _Alloc >::erase ( const_iterator  pos)
inline

◆ front() [1/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
const T& molpro::vector< T, _Alloc >::front ( ) const
inlinenoexcept

◆ front() [2/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
T& molpro::vector< T, _Alloc >::front ( )
inlinenoexcept

◆ max_size()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
size_t molpro::vector< T, _Alloc >::max_size ( ) const
inlinenoexcept

◆ operator=()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
vector<T, _Alloc>& molpro::vector< T, _Alloc >::operator= ( const vector< T, _Alloc > &  copy)
inline

Copy assignment operator.

◆ operator[]() [1/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
T& molpro::vector< T, _Alloc >::operator[] ( size_t  n)
inline

◆ operator[]() [2/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
const T& molpro::vector< T, _Alloc >::operator[] ( size_t  n) const
inline

◆ pop_back()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
void molpro::vector< T, _Alloc >::pop_back ( )
inline

◆ push_back() [1/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
void molpro::vector< T, _Alloc >::push_back ( const T &  value)
inline

◆ push_back() [2/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
void molpro::vector< T, _Alloc >::push_back ( T &&  value)
inline

◆ rbegin() [1/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
const_reverse_iterator molpro::vector< T, _Alloc >::rbegin ( ) const
inlinenoexcept

◆ rbegin() [2/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
reverse_iterator molpro::vector< T, _Alloc >::rbegin ( )
inlinenoexcept

◆ rend() [1/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
const_reverse_iterator molpro::vector< T, _Alloc >::rend ( ) const
inlinenoexcept

◆ rend() [2/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
reverse_iterator molpro::vector< T, _Alloc >::rend ( )
inlinenoexcept

◆ reserve()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
void molpro::vector< T, _Alloc >::reserve ( size_t  new_cap)
inline

◆ resize() [1/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
void molpro::vector< T, _Alloc >::resize ( size_t  n)
inline

Resize the buffer.

Parameters
nNew length in bytes.

◆ resize() [2/2]

template<typename T = double, typename _Alloc = molpro::allocator<T>>
void molpro::vector< T, _Alloc >::resize ( size_t  n,
const T &  val 
)
inline

Resize the buffer, and assign a value to any new elements if it grows.

Parameters
nNew length in bytes.
valValue to assign to new elements.

◆ shrink_to_fit()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
void molpro::vector< T, _Alloc >::shrink_to_fit ( )
inline

◆ size()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
size_t molpro::vector< T, _Alloc >::size ( ) const
inlinenoexcept

◆ str()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
std::string molpro::vector< T, _Alloc >::str ( int  verbosity = 1,
unsigned int  columns = UINT_MAX 
) const
inline

Generate a printable representation of the object.

Parameters
verbosityIf zero, express only the length of the object; otherwise, its elements.
columnsIf given, a line wrap will be generated every columns values.
Returns

◆ swap()

template<typename T = double, typename _Alloc = molpro::allocator<T>>
void molpro::vector< T, _Alloc >::swap ( vector< T, _Alloc > &  x)
inline

Exchange the content of the container by the content of x, which is another object of the same type.

Parameters
xAnother vector of the same type.

Friends And Related Function Documentation

◆ swap

template<typename T = double, typename _Alloc = molpro::allocator<T>>
void swap ( vector< T, _Alloc > &  a,
vector< T, _Alloc > &  b 
)
friend

The documentation for this class was generated from the following file: