NuTo
Numerics Tool
Public Member Functions | List of all members
NuTo::ValueVector< T > Class Template Reference

container that stores values of T and keeps references to these values valid More...

#include <ValueVector.h>

Public Member Functions

template<typename... TArgs>
T & Add (TArgs &&...args)
 
T & Add (T &&t)
 
IndirectIterator begin ()
 
IndirectIterator end ()
 
ConstIndirectIterator begin () const
 
ConstIndirectIterator end () const
 
Data::size_type Size () const
 
const T & operator[] (int i) const
 
T & operator[] (int i)
 
IndirectIterator Erase (IndirectIterator it)
 
IndirectIterator Erase (IndirectIterator from, IndirectIterator to)
 

Detailed Description

template<typename T>
class NuTo::ValueVector< T >

container that stores values of T and keeps references to these values valid

Remarks
Normally, it is a no-brainer to use boost::ptr_vector here. It provides all the nice value semantics for free. However, there is an issue regarding move. https://stackoverflow.com/questions/44130076/moving-a-boostptr-vector Therefore, here is a custom implementation with only the basic features.

Member Function Documentation

template<typename T>
template<typename... TArgs>
T& NuTo::ValueVector< T >::Add ( TArgs &&...  args)
inline
template<typename T>
T& NuTo::ValueVector< T >::Add ( T &&  t)
inline
template<typename T>
IndirectIterator NuTo::ValueVector< T >::begin ( )
inline
template<typename T>
ConstIndirectIterator NuTo::ValueVector< T >::begin ( ) const
inline
template<typename T>
IndirectIterator NuTo::ValueVector< T >::end ( )
inline
template<typename T>
ConstIndirectIterator NuTo::ValueVector< T >::end ( ) const
inline
template<typename T>
IndirectIterator NuTo::ValueVector< T >::Erase ( IndirectIterator  it)
inline
template<typename T>
IndirectIterator NuTo::ValueVector< T >::Erase ( IndirectIterator  from,
IndirectIterator  to 
)
inline
template<typename T>
const T& NuTo::ValueVector< T >::operator[] ( int  i) const
inline
template<typename T>
T& NuTo::ValueVector< T >::operator[] ( int  i)
inline
template<typename T>
Data::size_type NuTo::ValueVector< T >::Size ( ) const
inline

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