xtensor
Loading...
Searching...
No Matches
xt::svector< T, N, A, Init > Class Template Reference

Public Types

using self_type = svector<T, N, A, Init>
 
using allocator_type = A
 
using size_type = typename std::allocator_traits<A>::size_type
 
using value_type = typename std::allocator_traits<A>::value_type
 
using pointer = typename std::allocator_traits<A>::pointer
 
using const_pointer = typename std::allocator_traits<A>::const_pointer
 
using reference = value_type&
 
using const_reference = const value_type&
 
using difference_type = typename std::allocator_traits<A>::difference_type
 
using iterator = pointer
 
using const_iterator = const_pointer
 
using reverse_iterator = std::reverse_iterator<iterator>
 
using const_reverse_iterator = std::reverse_iterator<const_iterator>
 

Public Member Functions

 svector (const allocator_type &alloc) noexcept
 
 svector (size_type n, const allocator_type &alloc=allocator_type())
 
 svector (size_type n, const value_type &v, const allocator_type &alloc=allocator_type())
 
 svector (std::initializer_list< T > il, const allocator_type &alloc=allocator_type())
 
 svector (const std::vector< T > &vec)
 
template<class IT , class = detail::require_input_iter<IT>>
 svector (IT begin, IT end, const allocator_type &alloc=allocator_type())
 
template<std::size_t N2, bool I2, class = std::enable_if_t<N != N2, void>>
 svector (const svector< T, N2, A, I2 > &rhs)
 
svectoroperator= (const svector &rhs)
 
svectoroperator= (svector &&rhs) noexcept(std::is_nothrow_move_assignable< value_type >::value)
 
svectoroperator= (const std::vector< T > &rhs)
 
svectoroperator= (std::initializer_list< T > il)
 
template<std::size_t N2, bool I2, class = std::enable_if_t<N != N2, void>>
svectoroperator= (const svector< T, N2, A, I2 > &rhs)
 
 svector (const svector &other)
 
 svector (svector &&other) noexcept(std::is_nothrow_move_constructible< value_type >::value)
 
void assign (size_type n, const value_type &v)
 
template<class V >
void assign (std::initializer_list< V > il)
 
template<class IT >
void assign (IT other_begin, IT other_end)
 
reference operator[] (size_type idx)
 
const_reference operator[] (size_type idx) const
 
reference at (size_type idx)
 
const_reference at (size_type idx) const
 
pointer data ()
 
const_pointer data () const
 
void push_back (const T &elt)
 
void push_back (T &&elt)
 
void pop_back ()
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cend () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator crbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
const_reverse_iterator crend () const
 
bool empty () const
 
size_type size () const
 
void resize (size_type n)
 
size_type max_size () const noexcept
 
size_type capacity () const
 
void reserve (size_type n)
 
void shrink_to_fit ()
 
void clear ()
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
bool on_stack ()
 
iterator erase (const_iterator cit)
 
iterator erase (const_iterator cfirst, const_iterator clast)
 
iterator insert (const_iterator it, const T &elt)
 
template<class It >
iterator insert (const_iterator pos, It first, It last)
 
iterator insert (const_iterator pos, std::initializer_list< T > l)
 
template<std::size_t ON, class OA , bool InitA>
void swap (svector< T, ON, OA, InitA > &rhs)
 
allocator_type get_allocator () const noexcept
 
template<std::size_t N2, bool I2, class >
svector< T, N, A, Init > & operator= (const svector< T, N2, A, I2 > &rhs)
 
template<class It >
auto insert (const_iterator pos, It first, It last) -> iterator
 

Static Public Attributes

static constexpr std::size_t alignment
 

Detailed Description

template<class T, std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
class xt::svector< T, N, A, Init >

Definition at line 641 of file xstorage.hpp.

Member Typedef Documentation

◆ allocator_type

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
using xt::svector< T, N, A, Init >::allocator_type = A

Definition at line 646 of file xstorage.hpp.

◆ const_iterator

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
using xt::svector< T, N, A, Init >::const_iterator = const_pointer

Definition at line 656 of file xstorage.hpp.

◆ const_pointer

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
using xt::svector< T, N, A, Init >::const_pointer = typename std::allocator_traits<A>::const_pointer

Definition at line 650 of file xstorage.hpp.

◆ const_reference

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
using xt::svector< T, N, A, Init >::const_reference = const value_type&

Definition at line 652 of file xstorage.hpp.

◆ const_reverse_iterator

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
using xt::svector< T, N, A, Init >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 658 of file xstorage.hpp.

◆ difference_type

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
using xt::svector< T, N, A, Init >::difference_type = typename std::allocator_traits<A>::difference_type

Definition at line 653 of file xstorage.hpp.

◆ iterator

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
using xt::svector< T, N, A, Init >::iterator = pointer

Definition at line 655 of file xstorage.hpp.

◆ pointer

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
using xt::svector< T, N, A, Init >::pointer = typename std::allocator_traits<A>::pointer

Definition at line 649 of file xstorage.hpp.

◆ reference

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
using xt::svector< T, N, A, Init >::reference = value_type&

Definition at line 651 of file xstorage.hpp.

◆ reverse_iterator

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
using xt::svector< T, N, A, Init >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 657 of file xstorage.hpp.

◆ self_type

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
using xt::svector< T, N, A, Init >::self_type = svector<T, N, A, Init>

Definition at line 645 of file xstorage.hpp.

◆ size_type

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
using xt::svector< T, N, A, Init >::size_type = typename std::allocator_traits<A>::size_type

Definition at line 647 of file xstorage.hpp.

◆ value_type

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
using xt::svector< T, N, A, Init >::value_type = typename std::allocator_traits<A>::value_type

Definition at line 648 of file xstorage.hpp.

Constructor & Destructor Documentation

◆ svector() [1/10]

template<class T , std::size_t N, class A , bool Init>
xt::svector< T, N, A, Init >::svector ( )
inlinenoexcept

Definition at line 786 of file xstorage.hpp.

◆ ~svector()

template<class T , std::size_t N, class A , bool Init>
xt::svector< T, N, A, Init >::~svector ( )
inline

Definition at line 777 of file xstorage.hpp.

◆ svector() [2/10]

template<class T , std::size_t N, class A , bool Init>
xt::svector< T, N, A, Init >::svector ( const allocator_type & alloc)
inlineexplicitnoexcept

Definition at line 792 of file xstorage.hpp.

◆ svector() [3/10]

template<class T , std::size_t N, class A , bool Init>
xt::svector< T, N, A, Init >::svector ( size_type n,
const allocator_type & alloc = allocator_type() )
inlineexplicit

Definition at line 798 of file xstorage.hpp.

◆ svector() [4/10]

template<class T , std::size_t N, class A , bool Init>
xt::svector< T, N, A, Init >::svector ( size_type n,
const value_type & v,
const allocator_type & alloc = allocator_type() )
inline

Definition at line 834 of file xstorage.hpp.

◆ svector() [5/10]

template<class T , std::size_t N, class A , bool Init>
xt::svector< T, N, A, Init >::svector ( std::initializer_list< T > il,
const allocator_type & alloc = allocator_type() )
inline

Definition at line 841 of file xstorage.hpp.

◆ svector() [6/10]

template<class T , std::size_t N, class A , bool Init>
xt::svector< T, N, A, Init >::svector ( const std::vector< T > & vec)
inline

Definition at line 828 of file xstorage.hpp.

◆ svector() [7/10]

template<class T , std::size_t N, class A , bool Init>
template<class IT , class >
xt::svector< T, N, A, Init >::svector ( IT begin,
IT end,
const allocator_type & alloc = allocator_type() )
inline

Definition at line 813 of file xstorage.hpp.

◆ svector() [8/10]

template<class T , std::size_t N, class A , bool Init>
template<std::size_t N2, bool I2, class >
xt::svector< T, N, A, Init >::svector ( const svector< T, N2, A, I2 > & rhs)
inlineexplicit

Definition at line 821 of file xstorage.hpp.

◆ svector() [9/10]

template<class T , std::size_t N, class A , bool Init>
xt::svector< T, N, A, Init >::svector ( const svector< T, N, A, Init > & other)
inline

Definition at line 890 of file xstorage.hpp.

◆ svector() [10/10]

template<class T , std::size_t N, class A , bool Init>
xt::svector< T, N, A, Init >::svector ( svector< T, N, A, Init > && other)
inlinenoexcept

Definition at line 899 of file xstorage.hpp.

Member Function Documentation

◆ assign() [1/3]

template<class T , std::size_t N, class A , bool Init>
template<class IT >
void xt::svector< T, N, A, Init >::assign ( IT other_begin,
IT other_end )
inline

Definition at line 925 of file xstorage.hpp.

◆ assign() [2/3]

template<class T , std::size_t N, class A , bool Init>
void xt::svector< T, N, A, Init >::assign ( size_type n,
const value_type & v )
inline

Definition at line 906 of file xstorage.hpp.

◆ assign() [3/3]

template<class T , std::size_t N, class A , bool Init>
template<class V >
void xt::svector< T, N, A, Init >::assign ( std::initializer_list< V > il)
inline

Definition at line 918 of file xstorage.hpp.

◆ at() [1/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::at ( size_type idx)
inline

Definition at line 949 of file xstorage.hpp.

◆ at() [2/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::at ( size_type idx) const
inline

Definition at line 959 of file xstorage.hpp.

◆ back() [1/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::back ( )
inline

Definition at line 1153 of file xstorage.hpp.

◆ back() [2/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::back ( ) const
inline

Definition at line 1160 of file xstorage.hpp.

◆ begin() [1/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::begin ( )
inline

Definition at line 1055 of file xstorage.hpp.

◆ begin() [2/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::begin ( ) const
inline

Definition at line 1061 of file xstorage.hpp.

◆ capacity()

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::capacity ( ) const
inline

Definition at line 1002 of file xstorage.hpp.

◆ cbegin()

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::cbegin ( ) const
inline

Definition at line 1067 of file xstorage.hpp.

◆ cend()

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::cend ( ) const
inline

Definition at line 1085 of file xstorage.hpp.

◆ clear()

template<class T , std::size_t N, class A , bool Init>
void xt::svector< T, N, A, Init >::clear ( )
inline

Definition at line 1023 of file xstorage.hpp.

◆ crbegin()

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::crbegin ( ) const
inline

Definition at line 1103 of file xstorage.hpp.

◆ crend()

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::crend ( ) const
inline

Definition at line 1121 of file xstorage.hpp.

◆ data() [1/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::data ( )
inline

Definition at line 969 of file xstorage.hpp.

◆ data() [2/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::data ( ) const
inline

Definition at line 975 of file xstorage.hpp.

◆ empty()

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::empty ( ) const
inline

Definition at line 1133 of file xstorage.hpp.

◆ end() [1/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::end ( )
inline

Definition at line 1073 of file xstorage.hpp.

◆ end() [2/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::end ( ) const
inline

Definition at line 1079 of file xstorage.hpp.

◆ erase() [1/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::erase ( const_iterator cfirst,
const_iterator clast )
inline

Definition at line 1189 of file xstorage.hpp.

◆ erase() [2/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::erase ( const_iterator cit)
inline

Definition at line 1179 of file xstorage.hpp.

◆ front() [1/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::front ( )
inline

Definition at line 1139 of file xstorage.hpp.

◆ front() [2/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::front ( ) const
inline

Definition at line 1146 of file xstorage.hpp.

◆ get_allocator()

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::get_allocator ( ) const
inlinenoexcept

Definition at line 1173 of file xstorage.hpp.

◆ insert() [1/3]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::insert ( const_iterator it,
const T & elt )
inline

Definition at line 1205 of file xstorage.hpp.

◆ insert() [2/3]

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
template<class It >
auto xt::svector< T, N, A, Init >::insert ( const_iterator pos,
It first,
It last ) -> iterator
inline

Definition at line 1237 of file xstorage.hpp.

◆ insert() [3/3]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::insert ( const_iterator pos,
std::initializer_list< T > l )
inline

Definition at line 1258 of file xstorage.hpp.

◆ max_size()

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::max_size ( ) const
inlinenoexcept

Definition at line 996 of file xstorage.hpp.

◆ on_stack()

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::on_stack ( )
inline

Definition at line 1167 of file xstorage.hpp.

◆ operator=() [1/5]

template<class T , std::size_t N, class A , bool Init>
svector< T, N, A, Init > & xt::svector< T, N, A, Init >::operator= ( const std::vector< T > & rhs)
inline

Definition at line 863 of file xstorage.hpp.

◆ operator=() [2/5]

template<class T , std::size_t N, class A , bool Init>
svector< T, N, A, Init > & xt::svector< T, N, A, Init >::operator= ( const svector< T, N, A, Init > & rhs)
inline

Definition at line 848 of file xstorage.hpp.

◆ operator=() [3/5]

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
template<std::size_t N2, bool I2, class >
svector< T, N, A, Init > & xt::svector< T, N, A, Init >::operator= ( const svector< T, N2, A, I2 > & rhs)
inline

Definition at line 880 of file xstorage.hpp.

◆ operator=() [4/5]

template<class T , std::size_t N, class A , bool Init>
svector< T, N, A, Init > & xt::svector< T, N, A, Init >::operator= ( std::initializer_list< T > il)
inline

Definition at line 873 of file xstorage.hpp.

◆ operator=() [5/5]

template<class T , std::size_t N, class A , bool Init>
svector< T, N, A, Init > & xt::svector< T, N, A, Init >::operator= ( svector< T, N, A, Init > && rhs)
inlinenoexcept

Definition at line 855 of file xstorage.hpp.

◆ operator[]() [1/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::operator[] ( size_type idx)
inline

Definition at line 937 of file xstorage.hpp.

◆ operator[]() [2/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::operator[] ( size_type idx) const
inline

Definition at line 943 of file xstorage.hpp.

◆ pop_back()

template<class T , std::size_t N, class A , bool Init>
void xt::svector< T, N, A, Init >::pop_back ( )

Definition at line 1049 of file xstorage.hpp.

◆ push_back() [1/2]

template<class T , std::size_t N, class A , bool Init>
void xt::svector< T, N, A, Init >::push_back ( const T & elt)

Definition at line 1029 of file xstorage.hpp.

◆ push_back() [2/2]

template<class T , std::size_t N, class A , bool Init>
void xt::svector< T, N, A, Init >::push_back ( T && elt)

Definition at line 1039 of file xstorage.hpp.

◆ rbegin() [1/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::rbegin ( )
inline

Definition at line 1091 of file xstorage.hpp.

◆ rbegin() [2/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::rbegin ( ) const
inline

Definition at line 1097 of file xstorage.hpp.

◆ rend() [1/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::rend ( )
inline

Definition at line 1109 of file xstorage.hpp.

◆ rend() [2/2]

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::rend ( ) const
inline

Definition at line 1115 of file xstorage.hpp.

◆ reserve()

template<class T , std::size_t N, class A , bool Init>
void xt::svector< T, N, A, Init >::reserve ( size_type n)
inline

Definition at line 1008 of file xstorage.hpp.

◆ resize()

template<class T , std::size_t N, class A , bool Init>
void xt::svector< T, N, A, Init >::resize ( size_type n)

Definition at line 981 of file xstorage.hpp.

◆ shrink_to_fit()

template<class T , std::size_t N, class A , bool Init>
void xt::svector< T, N, A, Init >::shrink_to_fit ( )
inline

Definition at line 1017 of file xstorage.hpp.

◆ size()

template<class T , std::size_t N, class A , bool Init>
auto xt::svector< T, N, A, Init >::size ( ) const
inline

Definition at line 1127 of file xstorage.hpp.

◆ swap()

template<class T , std::size_t N, class A , bool Init>
template<std::size_t ON, class OA , bool InitA>
void xt::svector< T, N, A, Init >::swap ( svector< T, ON, OA, InitA > & rhs)
inline

Definition at line 1278 of file xstorage.hpp.

Member Data Documentation

◆ alignment

template<class T , std::size_t N = 4, class A = std::allocator<T>, bool Init = true>
constexpr std::size_t xt::svector< T, N, A, Init >::alignment
staticconstexpr
Initial value:
= detail::allocator_alignment<A>::value != 0
? detail::allocator_alignment<A>::value
: alignof(T)

Definition at line 663 of file xstorage.hpp.


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