LTOList
Classes | Public Types | Public Member Functions | List of all members
LTOList< T > Class Template Reference

#include <LTOList.hpp>

Classes

class  const_iterator
 
class  iterator
 

Public Types

using value_type = T
 
using size_type = size_t
 
using difference_type = ptrdiff_t
 
using reference = T &
 
using const_reference = const T &
 
using pointer = T *
 
using const_pointer = const T *
 

Public Member Functions

 LTOList (LTOList &&other)
 
 LTOList (const LTOList &other)
 
 LTOList (std::initializer_list< T > init)
 
iterator begin ()
 
iterator end ()
 
iterator rbegin ()
 
iterator rend ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator rbegin () const
 
const_iterator rend () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_iterator crbegin () const
 
const_iterator crend () const
 
size_type size () const
 
bool empty () const
 
reference at (size_type i)
 
const_reference at (size_type i) const
 
reference operator[] (size_type i)
 
const_reference operator[] (size_type i) const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
iterator insert (size_type side, iterator position, const_reference val)
 
iterator insert (size_type side, iterator position, T &&val)
 
template<class... Args>
iterator emplace (size_type side, iterator position, Args... args)
 
iterator insert (iterator position, const_reference val)
 
iterator insert (iterator position, T &&val)
 
template<class... Args>
iterator emplace (iterator position, Args... args)
 
void insert (size_type side, iterator position, size_type n, const_reference val)
 
template<class... Args>
void emplace (size_type side, iterator position, size_type n, Args... args)
 
void insert (iterator position, size_type n, const_reference val)
 
template<class... Args>
void emplace (iterator position, size_type n, Args... args)
 
template<class InputIterator >
void insert (size_type side, iterator position, InputIterator elem_begin, InputIterator elem_end)
 
template<class InputIterator >
void insert (iterator position, InputIterator elem_begin, InputIterator elem_end)
 
iterator erase (iterator position)
 
iterator erase (const_iterator position)
 
iterator erase (iterator elem_begin, iterator elem_end)
 
iterator erase (const_iterator elem_begin, const_iterator elem_end)
 
template<class InputIterator >
void assign (InputIterator elem_begin, InputIterator elem_end)
 
void assign (size_type n, const T &val)
 
void push_front (const T &val)
 
void push_front (T &&val)
 
template<class... Args>
void emplace_front (Args... args)
 
void push_back (const T &val)
 
void push_back (T &&val)
 
template<class... Args>
void emplace_back (Args... args)
 
void pop_front ()
 
void pop_back ()
 
void clear ()
 
void swap (LTOList< T > &other)
 

Detailed Description

template<class T>
class LTOList< T >

Class for LTOList.

TODO: Allocators are not supported yet.

Member Typedef Documentation

◆ const_pointer

template<class T>
using LTOList< T >::const_pointer = const T *

The type of a constant-pointer for elements that the LTOList can store.

◆ const_reference

template<class T>
using LTOList< T >::const_reference = const T &

The type of a constant-reference for elements that the LTOList can store.

◆ difference_type

template<class T>
using LTOList< T >::difference_type = ptrdiff_t

The integer type that represents the difference of two indices in LTOList.

◆ pointer

template<class T>
using LTOList< T >::pointer = T *

The type of a pointer for elements that the LTOList can store.

◆ reference

template<class T>
using LTOList< T >::reference = T &

The type of a reference for elements that the LTOList can store.

◆ size_type

template<class T>
using LTOList< T >::size_type = size_t

The integer type that represents the number of elements in LTOList.

◆ value_type

template<class T>
using LTOList< T >::value_type = T

The type of elements that the LTOList can store.

Member Function Documentation

◆ emplace() [1/4]

template<class T>
template<class... Args>
iterator LTOList< T >::emplace ( iterator  position,
Args...  args 
)
inline

◆ emplace() [2/4]

template<class T>
template<class... Args>
void LTOList< T >::emplace ( iterator  position,
size_type  n,
Args...  args 
)
inline

Same as emplace(size_type side, iterator position, size_type n, Args... args) with side = 0 .

◆ emplace() [3/4]

template<class T>
template<class... Args>
iterator LTOList< T >::emplace ( size_type  side,
iterator  position,
Args...  args 
)
inline

Inserts an element to this LTOList, before or after the specified element.

Parameters
sideIf it is 0, the new element is stored before position. Otherwise it is stored after position.
positionThe iterator at which the new element is stored.
argsThe new element. It considers args as the arguments of the constructor of LTOList::value_type, and the constructed element is inserted into LTOList.

◆ emplace() [4/4]

template<class T>
template<class... Args>
void LTOList< T >::emplace ( size_type  side,
iterator  position,
size_type  n,
Args...  args 
)
inline

Inserts specified number of elements to this LTOList, before or after the specified element.

Parameters
sideIf it is 0, the new element is stored before position. Otherwise it is stored after position. If position is end(), side must be 0; otherwise an exception std::invalid_argument is raised.
positionThe iterator at which the new element is stored.
nThe number of insertions.
argsThe new element. It considers args as the arguments of the constructor of LTOList::value_type, and the constructed element is inserted into LTOList.

◆ insert() [1/8]

template<class T>
iterator LTOList< T >::insert ( iterator  position,
const_reference  val 
)
inline

◆ insert() [2/8]

template<class T>
template<class InputIterator >
void LTOList< T >::insert ( iterator  position,
InputIterator  elem_begin,
InputIterator  elem_end 
)
inline

Same as insert(size_type side, iterator position, InputIterator elem_begin, InputIterator elem_end) with side = 0 .

◆ insert() [3/8]

template<class T>
void LTOList< T >::insert ( iterator  position,
size_type  n,
const_reference  val 
)
inline

Same as insert(size_type side, iterator position, size_type n, const_reference val) with side = 0 .

◆ insert() [4/8]

template<class T>
iterator LTOList< T >::insert ( iterator  position,
T &&  val 
)
inline

◆ insert() [5/8]

template<class T>
iterator LTOList< T >::insert ( size_type  side,
iterator  position,
const_reference  val 
)
inline

Inserts an element to this LTOList, before or after the specified element.

Parameters
sideIf it is 0, the new element is stored before position. Otherwise it is stored after position. If position is end(), side must be 0; otherwise an exception std::invalid_argument is raised.
positionThe iterator at which the new element is stored.
valThe new element. It is copied to be stored into LTOList.

◆ insert() [6/8]

template<class T>
template<class InputIterator >
void LTOList< T >::insert ( size_type  side,
iterator  position,
InputIterator  elem_begin,
InputIterator  elem_end 
)
inline

Inserts a bunch of elements to this LTOList, before or after the specified element.

Parameters
sideIf it is 0, the new element is stored before position. Otherwise it is stored after position. If position is end(), side must be 0; otherwise an exception std::invalid_argument is raised.
positionThe iterator at which the new element is stored.
elem_beginThe iterator (any iterator that points LTOList::value_type is accepted; not limited to LTOList::iterator) for the first element to be inserted.
elem_endThe iterator (any iterator that points LTOList::value_type is accepted; not limited to LTOList::iterator) before the last element to be inserted.

◆ insert() [7/8]

template<class T>
void LTOList< T >::insert ( size_type  side,
iterator  position,
size_type  n,
const_reference  val 
)
inline

Inserts specified number of elements to this LTOList, before or after the specified element.

Parameters
sideIf it is 0, the new element is stored before position. Otherwise it is stored after position. If position is end(), side must be 0; otherwise an exception std::invalid_argument is raised.
positionThe iterator at which the new element is stored.
nThe number of insertions.
valThe new element. It is copied to be stored into LTOList.

◆ insert() [8/8]

template<class T>
iterator LTOList< T >::insert ( size_type  side,
iterator  position,
T &&  val 
)
inline

Inserts an element to this LTOList, before or after the specified element.

Parameters
sideIf it is 0, the new element is stored before position. Otherwise it is stored after position. If position is end(), side must be 0; otherwise an exception std::invalid_argument is raised.
positionThe iterator at which the new element is stored.
valThe new element. It is "moved" to be stored into LTOList (i.e., the value in val may be deleted).

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