deal.II version GIT relicensing-6960-g70e9c5b7be 2026-10-22 20:10:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Classes | Private Types | Private Member Functions | Private Attributes | Related Symbols | List of all members
std_cxx26::inplace_vector< T, N > Class Template Reference

#include <deal.II/base/std_cxx26/inplace_vector.h>

Detailed Description

template<typename T, std::size_t N>
class std_cxx26::inplace_vector< T, N >

C++17-implementation of a subset of std::inplace_vector.

Differences:

  1. The number of elements is limited to the maximum value of an unsigned short, which is typically 65535.
  2. This class lacks optimized storage for the N = 0 case.
  3. Since std::lexicographical_compare() and std::equal() are not constexpr prior to C++20, the comparison operators are not constexpr.
  4. Since operator<=>() is not available prior to C++20, this class implements the full set of comparison operators.
  5. The range constructor is not present sinces ranges were not available prior to C++20.
  6. Since std::optional<T&> was not available prior to C++26, this class does not support try_emplace_back() etc.
  7. Since placement new() is not constexpr prior to C++26, the majority of the constructors and assignment operators are not constexpr.

Furthermore, copy and move constructors, copy and move assignment operators, and the destructor are only trivial if both T is trivial for that function and C++20 is available, since declaring this property for a user-defined class requires concepts.

See https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2747r2.html for more information.

Definition at line 77 of file inplace_vector.h.

Inheritance diagram for std_cxx26::inplace_vector< T, N >:
[legend]

Classes

class  SingleInputIterator
 

Public Types

using value_type = T
 
using size_type = std::size_t
 
using difference_type = std::ptrdiff_t
 
using reference = value_type &
 
using const_reference = const value_type &
 
using pointer = value_type *
 
using const_pointer = const value_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

 inplace_vector (size_type n)
 
 inplace_vector (size_type n, const T &value)
 
template<class InputIterator >
 inplace_vector (InputIterator first, InputIterator last)
 
 inplace_vector (const inplace_vector &other) noexcept(std::is_nothrow_copy_constructible_v< T >)
 
 inplace_vector (inplace_vector &&other) noexcept(std::is_nothrow_move_constructible_v< T >)
 
constexpr inplace_vector (std::initializer_list< T > init)
 
inplace_vector & operator= (const inplace_vector &other)
 
inplace_vector & operator= (inplace_vector &&other) noexcept(std::is_nothrow_move_assignable_v< T > &&std::is_nothrow_move_constructible_v< T >)
 
inplace_vector & operator= (std::initializer_list< T > init)
 
template<class InputIterator >
void assign (InputIterator first, InputIterator last)
 
void assign (size_type n, const T &value)
 
void assign (std::initializer_list< T > init)
 
constexpr iterator begin () noexcept
 
constexpr iterator end () noexcept
 
constexpr const_iterator begin () const noexcept
 
constexpr const_iterator end () const noexcept
 
constexpr reverse_iterator rbegin () noexcept
 
constexpr reverse_iterator rend () noexcept
 
constexpr const_reverse_iterator rbegin () const noexcept
 
constexpr const_reverse_iterator rend () const noexcept
 
constexpr const_iterator cbegin () const noexcept
 
constexpr const_iterator cend () const noexcept
 
constexpr const_reverse_iterator crbegin () const noexcept
 
constexpr const_reverse_iterator crend () const noexcept
 
reference operator[] (size_type n)
 
const_reference operator[] (size_type n) const
 
reference at (size_type n)
 
const_reference at (size_type n) const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
T * data () noexcept
 
const T * data () const noexcept
 

Private Types

using buffer_size_type = std::conditional_t< N<=std::numeric_limits< std::uint8_t >::max(), std::uint8_t, std::uint16_t >
 

Private Member Functions

template<bool check = false, typename... Args>
constexpr void internal_resize (const size_type n, Args &&...args) noexcept(!check)
 
template<typename InputIterator , bool check = false, bool move = false>
void internal_assign (InputIterator first, InputIterator last) noexcept(!check &&(move ? std::is_nothrow_move_assignable_v< T > :std::is_nothrow_copy_assignable_v< T >))
 
template<typename InputIterator , bool check = false, bool move = false>
constexpr size_type internal_append (InputIterator first, InputIterator last) noexcept(!check &&(move ? std::is_nothrow_move_constructible_v< T > :std::is_nothrow_copy_constructible_v< T >))
 

Private Attributes

union { 
 
   T   elements [N > 0 ? N :1] 
 
};  
 
buffer_size_type n_elements
 

Related Symbols

(Note that these are not member symbols.)

template<typename T , std::size_t N, typename U = T>
std::size_t erase (std_cxx26::inplace_vector< T, N > &vec, const U &value)
 
template<typename T , std::size_t N, typename Predicate >
std::size_t erase_if (std_cxx26::inplace_vector< T, N > &vec, Predicate pred)
 
template<typename T , std::size_t N>
bool operator== (const inplace_vector< T, N > &a, const inplace_vector< T, N > &b)
 
template<typename T , std::size_t N>
bool operator!= (const inplace_vector< T, N > &a, const inplace_vector< T, N > &b)
 
template<typename T , std::size_t N>
bool operator< (const inplace_vector< T, N > &a, const inplace_vector< T, N > &b)
 
template<typename T , std::size_t N>
bool operator> (const inplace_vector< T, N > &a, const inplace_vector< T, N > &b)
 
template<typename T , std::size_t N>
bool operator<= (const inplace_vector< T, N > &a, const inplace_vector< T, N > &b)
 
template<typename T , std::size_t N>
bool operator>= (const inplace_vector< T, N > &a, const inplace_vector< T, N > &b)
 
constexpr bool empty () const noexcept
 
constexpr size_type size () const noexcept
 
void resize (size_type n)
 
void resize (size_type n, const T &value)
 
static constexpr size_type max_size () noexcept
 
static constexpr size_type capacity () noexcept
 
static constexpr void reserve (size_type n)
 
static constexpr void shrink_to_fit () noexcept
 
template<class... Args>
reference emplace_back (Args &&...args)
 
reference push_back (const T &value)
 
reference push_back (T &&value)
 
void pop_back ()
 
template<class... Args>
reference unchecked_emplace_back (Args &&...args)
 
reference unchecked_push_back (const T &value)
 
reference unchecked_push_back (T &&value)
 
template<class... Args>
iterator emplace (const_iterator position, Args &&...args)
 
iterator insert (const_iterator position, const T &value)
 
iterator insert (const_iterator position, T &&value)
 
iterator insert (const_iterator position, size_type n, const T &value)
 
template<typename InputIterator >
iterator insert (const_iterator position, InputIterator first, InputIterator last)
 
iterator insert (const_iterator position, std::initializer_list< T > init)
 
iterator erase (const_iterator position)
 
iterator erase (const_iterator first, const_iterator last)
 
void swap (inplace_vector &other) noexcept(std::is_nothrow_swappable_v< T > &&std::is_nothrow_move_constructible_v< T >)
 
constexpr void clear () noexcept
 
void swap (inplace_vector &x, inplace_vector &y) noexcept(std::is_nothrow_swappable_v< T > &&std::is_nothrow_move_constructible_v< T >)
 

Member Typedef Documentation

◆ value_type

template<typename T , std::size_t N>
using std_cxx26::inplace_vector< T, N >::value_type = T

Types.

Definition at line 84 of file inplace_vector.h.

◆ size_type

template<typename T , std::size_t N>
using std_cxx26::inplace_vector< T, N >::size_type = std::size_t

Definition at line 85 of file inplace_vector.h.

◆ difference_type

template<typename T , std::size_t N>
using std_cxx26::inplace_vector< T, N >::difference_type = std::ptrdiff_t

Definition at line 86 of file inplace_vector.h.

◆ reference

template<typename T , std::size_t N>
using std_cxx26::inplace_vector< T, N >::reference = value_type &

Definition at line 87 of file inplace_vector.h.

◆ const_reference

template<typename T , std::size_t N>
using std_cxx26::inplace_vector< T, N >::const_reference = const value_type &

Definition at line 88 of file inplace_vector.h.

◆ pointer

template<typename T , std::size_t N>
using std_cxx26::inplace_vector< T, N >::pointer = value_type *

Definition at line 89 of file inplace_vector.h.

◆ const_pointer

template<typename T , std::size_t N>
using std_cxx26::inplace_vector< T, N >::const_pointer = const value_type *

Definition at line 90 of file inplace_vector.h.

◆ iterator

template<typename T , std::size_t N>
using std_cxx26::inplace_vector< T, N >::iterator = pointer

Definition at line 91 of file inplace_vector.h.

◆ const_iterator

template<typename T , std::size_t N>
using std_cxx26::inplace_vector< T, N >::const_iterator = const_pointer

Definition at line 92 of file inplace_vector.h.

◆ reverse_iterator

template<typename T , std::size_t N>
using std_cxx26::inplace_vector< T, N >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 94 of file inplace_vector.h.

◆ const_reverse_iterator

template<typename T , std::size_t N>
using std_cxx26::inplace_vector< T, N >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 95 of file inplace_vector.h.

◆ buffer_size_type

template<typename T , std::size_t N>
using std_cxx26::inplace_vector< T, N >::buffer_size_type = std::conditional_t<N <= std::numeric_limits<std::uint8_t>::max(), std::uint8_t, std::uint16_t>
private

Definition at line 1075 of file inplace_vector.h.

Constructor & Destructor Documentation

◆ inplace_vector() [1/7]

template<typename T , std::size_t N>
constexpr std_cxx26::inplace_vector< T, N >::inplace_vector ( )
inlineconstexprnoexcept

Constructors and destructor. Default constructor.

Definition at line 106 of file inplace_vector.h.

◆ inplace_vector() [2/7]

template<typename T , std::size_t N>
std_cxx26::inplace_vector< T, N >::inplace_vector ( size_type  n)
inlineexplicit

Constructor which default initializes n objects.

Definition at line 113 of file inplace_vector.h.

◆ inplace_vector() [3/7]

template<typename T , std::size_t N>
std_cxx26::inplace_vector< T, N >::inplace_vector ( size_type  n,
const T &  value 
)
inline

Constructor which creates n objects by copying value.

Definition at line 122 of file inplace_vector.h.

◆ inplace_vector() [4/7]

template<typename T , std::size_t N>
template<class InputIterator >
std_cxx26::inplace_vector< T, N >::inplace_vector ( InputIterator  first,
InputIterator  last 
)
inline

Constructor which copies an iterator range.

Definition at line 135 of file inplace_vector.h.

◆ inplace_vector() [5/7]

template<typename T , std::size_t N>
std_cxx26::inplace_vector< T, N >::inplace_vector ( const inplace_vector< T, N > &  other)
inlinenoexcept

Copy constructor.

Definition at line 159 of file inplace_vector.h.

◆ inplace_vector() [6/7]

template<typename T , std::size_t N>
std_cxx26::inplace_vector< T, N >::inplace_vector ( inplace_vector< T, N > &&  other)
inlinenoexcept

Move constructor.

Definition at line 178 of file inplace_vector.h.

◆ inplace_vector() [7/7]

template<typename T , std::size_t N>
constexpr std_cxx26::inplace_vector< T, N >::inplace_vector ( std::initializer_list< T >  init)
inlineconstexpr

Copy constructor from an initializer list.

Definition at line 188 of file inplace_vector.h.

◆ ~inplace_vector()

template<typename T , std::size_t N>
std_cxx26::inplace_vector< T, N >::~inplace_vector ( )
inline

Definition at line 211 of file inplace_vector.h.

Member Function Documentation

◆ operator=() [1/3]

template<typename T , std::size_t N>
inplace_vector & std_cxx26::inplace_vector< T, N >::operator= ( const inplace_vector< T, N > &  other)
inline

Assignment operators. Trivial copy assignment operator. Requires C++20. Copy assignment operator.

Definition at line 238 of file inplace_vector.h.

◆ operator=() [2/3]

template<typename T , std::size_t N>
inplace_vector & std_cxx26::inplace_vector< T, N >::operator= ( inplace_vector< T, N > &&  other)
inlinenoexcept

Move assignment operator.

Definition at line 262 of file inplace_vector.h.

◆ operator=() [3/3]

template<typename T , std::size_t N>
inplace_vector & std_cxx26::inplace_vector< T, N >::operator= ( std::initializer_list< T >  init)
inline

Copy assignment operator (from an initializer list).

Definition at line 276 of file inplace_vector.h.

◆ assign() [1/3]

template<typename T , std::size_t N>
template<class InputIterator >
void std_cxx26::inplace_vector< T, N >::assign ( InputIterator  first,
InputIterator  last 
)
inline

Assignment functions. Assign the contents of the vector to values in the input iterator range.

Definition at line 297 of file inplace_vector.h.

◆ assign() [2/3]

template<typename T , std::size_t N>
void std_cxx26::inplace_vector< T, N >::assign ( size_type  n,
const T &  value 
)
inline

Assign the contents of the vector to n copies of value.

Definition at line 309 of file inplace_vector.h.

◆ assign() [3/3]

template<typename T , std::size_t N>
void std_cxx26::inplace_vector< T, N >::assign ( std::initializer_list< T >  init)
inline

Assign the contents of the vector to values in the initializer list.

Definition at line 322 of file inplace_vector.h.

◆ begin() [1/2]

template<typename T , std::size_t N>
constexpr iterator std_cxx26::inplace_vector< T, N >::begin ( )
inlineconstexprnoexcept

Iterators. Begin iterator.

Definition at line 339 of file inplace_vector.h.

◆ end() [1/2]

template<typename T , std::size_t N>
constexpr iterator std_cxx26::inplace_vector< T, N >::end ( )
inlineconstexprnoexcept

End iterator.

Definition at line 348 of file inplace_vector.h.

◆ begin() [2/2]

template<typename T , std::size_t N>
constexpr const_iterator std_cxx26::inplace_vector< T, N >::begin ( ) const
inlineconstexprnoexcept

Constant begin iterator.

Definition at line 357 of file inplace_vector.h.

◆ end() [2/2]

template<typename T , std::size_t N>
constexpr const_iterator std_cxx26::inplace_vector< T, N >::end ( ) const
inlineconstexprnoexcept

Constant end iterator.

Definition at line 366 of file inplace_vector.h.

◆ rbegin() [1/2]

template<typename T , std::size_t N>
constexpr reverse_iterator std_cxx26::inplace_vector< T, N >::rbegin ( )
inlineconstexprnoexcept

Reverse begin iterator.

Definition at line 375 of file inplace_vector.h.

◆ rend() [1/2]

template<typename T , std::size_t N>
constexpr reverse_iterator std_cxx26::inplace_vector< T, N >::rend ( )
inlineconstexprnoexcept

Reverse end iterator.

Definition at line 384 of file inplace_vector.h.

◆ rbegin() [2/2]

template<typename T , std::size_t N>
constexpr const_reverse_iterator std_cxx26::inplace_vector< T, N >::rbegin ( ) const
inlineconstexprnoexcept

Constant reverse begin iterator.

Definition at line 393 of file inplace_vector.h.

◆ rend() [2/2]

template<typename T , std::size_t N>
constexpr const_reverse_iterator std_cxx26::inplace_vector< T, N >::rend ( ) const
inlineconstexprnoexcept

Constant reverse end iterator.

Definition at line 402 of file inplace_vector.h.

◆ cbegin()

template<typename T , std::size_t N>
constexpr const_iterator std_cxx26::inplace_vector< T, N >::cbegin ( ) const
inlineconstexprnoexcept

Constant begin iterator.

Definition at line 411 of file inplace_vector.h.

◆ cend()

template<typename T , std::size_t N>
constexpr const_iterator std_cxx26::inplace_vector< T, N >::cend ( ) const
inlineconstexprnoexcept

Constant end iterator.

Definition at line 420 of file inplace_vector.h.

◆ crbegin()

template<typename T , std::size_t N>
constexpr const_reverse_iterator std_cxx26::inplace_vector< T, N >::crbegin ( ) const
inlineconstexprnoexcept

Constant reverse begin iterator.

Definition at line 429 of file inplace_vector.h.

◆ crend()

template<typename T , std::size_t N>
constexpr const_reverse_iterator std_cxx26::inplace_vector< T, N >::crend ( ) const
inlineconstexprnoexcept

Constant reverse end iterator.

Definition at line 438 of file inplace_vector.h.

◆ empty()

template<typename T , std::size_t N>
constexpr bool std_cxx26::inplace_vector< T, N >::empty ( ) const
inlineconstexprnoexcept

Capacity. Return whether or not the vector contains any objects.

Definition at line 452 of file inplace_vector.h.

◆ size()

template<typename T , std::size_t N>
constexpr size_type std_cxx26::inplace_vector< T, N >::size ( ) const
inlineconstexprnoexcept

Return the number of objects in the vector.

Definition at line 461 of file inplace_vector.h.

◆ max_size()

template<typename T , std::size_t N>
static constexpr size_type std_cxx26::inplace_vector< T, N >::max_size ( )
inlinestaticconstexprnoexcept

Maximum possible size of the vector.

Definition at line 471 of file inplace_vector.h.

◆ capacity()

template<typename T , std::size_t N>
static constexpr size_type std_cxx26::inplace_vector< T, N >::capacity ( )
inlinestaticconstexprnoexcept

Maximum possible capacity of the vector.

Definition at line 480 of file inplace_vector.h.

◆ resize() [1/2]

template<typename T , std::size_t N>
void std_cxx26::inplace_vector< T, N >::resize ( size_type  n)
inline

Resize the vector to have n objects.

Definition at line 489 of file inplace_vector.h.

◆ resize() [2/2]

template<typename T , std::size_t N>
void std_cxx26::inplace_vector< T, N >::resize ( size_type  n,
const T &  value 
)
inline

Resize the vector to have n objects by constructing new objects with copies of value.

Definition at line 499 of file inplace_vector.h.

◆ reserve()

template<typename T , std::size_t N>
static constexpr void std_cxx26::inplace_vector< T, N >::reserve ( size_type  n)
inlinestaticconstexpr

If \(n > N\) then throw an exception. This function exists for compatibility with other containers but, since this vector has a fixed internal storage size, calling this function does not affect the object in any way.

Definition at line 511 of file inplace_vector.h.

◆ shrink_to_fit()

template<typename T , std::size_t N>
static constexpr void std_cxx26::inplace_vector< T, N >::shrink_to_fit ( )
inlinestaticconstexprnoexcept

This function does nothing for inplace_vector and exists for compatibility with other containers.

Definition at line 522 of file inplace_vector.h.

◆ operator[]() [1/2]

template<typename T , std::size_t N>
reference std_cxx26::inplace_vector< T, N >::operator[] ( size_type  n)
inline

Element access. Return a reference to the n-th element.

Definition at line 535 of file inplace_vector.h.

◆ operator[]() [2/2]

template<typename T , std::size_t N>
const_reference std_cxx26::inplace_vector< T, N >::operator[] ( size_type  n) const
inline

Return a constant reference to the n-th element.

Definition at line 545 of file inplace_vector.h.

◆ at() [1/2]

template<typename T , std::size_t N>
reference std_cxx26::inplace_vector< T, N >::at ( size_type  n)
inline

If \(n\) is less than size() then return a reference to the n-th element: otherwise throw an exception.

Definition at line 556 of file inplace_vector.h.

◆ at() [2/2]

template<typename T , std::size_t N>
const_reference std_cxx26::inplace_vector< T, N >::at ( size_type  n) const
inline

If \(n\) is less than size() then return a constant reference to the n-th element: otherwise throw an exception.

Definition at line 569 of file inplace_vector.h.

◆ front() [1/2]

template<typename T , std::size_t N>
reference std_cxx26::inplace_vector< T, N >::front ( )
inline

Return a reference to the first object in the vector.

Definition at line 581 of file inplace_vector.h.

◆ front() [2/2]

template<typename T , std::size_t N>
const_reference std_cxx26::inplace_vector< T, N >::front ( ) const
inline

Return a constant reference to the first object in the vector.

Definition at line 591 of file inplace_vector.h.

◆ back() [1/2]

template<typename T , std::size_t N>
reference std_cxx26::inplace_vector< T, N >::back ( )
inline

Return a reference to the last object in the vector.

Definition at line 601 of file inplace_vector.h.

◆ back() [2/2]

template<typename T , std::size_t N>
const_reference std_cxx26::inplace_vector< T, N >::back ( ) const
inline

Return a constant reference to the last object in the vector.

Definition at line 611 of file inplace_vector.h.

◆ data() [1/2]

template<typename T , std::size_t N>
T * std_cxx26::inplace_vector< T, N >::data ( )
inlinenoexcept

Data access. Return a pointer to all objects in the vector.

Note
This does not return a nullptr to signify no objects.

Definition at line 629 of file inplace_vector.h.

◆ data() [2/2]

template<typename T , std::size_t N>
const T * std_cxx26::inplace_vector< T, N >::data ( ) const
inlinenoexcept

Return a constant pointer to all objects in the vector.

Note
This does not return a nullptr to signify no objects.

Definition at line 640 of file inplace_vector.h.

◆ emplace_back()

template<typename T , std::size_t N>
template<class... Args>
reference std_cxx26::inplace_vector< T, N >::emplace_back ( Args &&...  args)
inline

Modifiers. Construct a new object at the end of the vector by forwarding all arguments to its constructor.

Note
If the vector is full before this function is called then an exception is thrown.

Definition at line 660 of file inplace_vector.h.

◆ push_back() [1/2]

template<typename T , std::size_t N>
reference std_cxx26::inplace_vector< T, N >::push_back ( const T &  value)
inline

Construct a new object at the end of the vector by copying value.

Note
If the vector is full before this function is called then an exception is thrown.

Definition at line 673 of file inplace_vector.h.

◆ push_back() [2/2]

template<typename T , std::size_t N>
reference std_cxx26::inplace_vector< T, N >::push_back ( T &&  value)
inline

Construct a new object at the end of the vector by moving value.

Note
If the vector is full before this function is called then an exception is thrown.

Definition at line 686 of file inplace_vector.h.

◆ pop_back()

template<typename T , std::size_t N>
void std_cxx26::inplace_vector< T, N >::pop_back ( )
inline

Destruct the last object in the vector and reduce the size of this object by one.

Definition at line 697 of file inplace_vector.h.

◆ unchecked_emplace_back()

template<typename T , std::size_t N>
template<class... Args>
reference std_cxx26::inplace_vector< T, N >::unchecked_emplace_back ( Args &&...  args)
inline

Construct a new object at the end of the vector by forwarding all objects to its constructor.

Note
Unlike the checked versions, this function will not throw an out of memory exception if the vector's capacity is exceeded.

Definition at line 712 of file inplace_vector.h.

◆ unchecked_push_back() [1/2]

template<typename T , std::size_t N>
reference std_cxx26::inplace_vector< T, N >::unchecked_push_back ( const T &  value)
inline

Construct a new object at the end of the vector by copying value.

Note
Unlike the checked versions, this function will not throw an out of memory exception if the vector's capacity is exceeded.

Definition at line 726 of file inplace_vector.h.

◆ unchecked_push_back() [2/2]

template<typename T , std::size_t N>
reference std_cxx26::inplace_vector< T, N >::unchecked_push_back ( T &&  value)
inline

Construct a new object at the end of the vector by moving value.

Note
Unlike the checked versions, this function will not throw an out of memory exception if the vector's capacity is exceeded.

Definition at line 740 of file inplace_vector.h.

◆ emplace()

template<typename T , std::size_t N>
template<class... Args>
iterator std_cxx26::inplace_vector< T, N >::emplace ( const_iterator  position,
Args &&...  args 
)
inline

Construct a new object at the location of position by forwarding all objects (args etc.) to its constructor.

Definition at line 753 of file inplace_vector.h.

◆ insert() [1/5]

template<typename T , std::size_t N>
iterator std_cxx26::inplace_vector< T, N >::insert ( const_iterator  position,
const T &  value 
)
inline

Construct a new object at the location of position by copying value.

Definition at line 773 of file inplace_vector.h.

◆ insert() [2/5]

template<typename T , std::size_t N>
iterator std_cxx26::inplace_vector< T, N >::insert ( const_iterator  position,
T &&  value 
)
inline

Construct a new object at the location of position by moving value.

Definition at line 782 of file inplace_vector.h.

◆ insert() [3/5]

template<typename T , std::size_t N>
iterator std_cxx26::inplace_vector< T, N >::insert ( const_iterator  position,
size_type  n,
const T &  value 
)
inline

Construct \(n\) new objects at the location of position by copying value.

Definition at line 791 of file inplace_vector.h.

◆ insert() [4/5]

template<typename T , std::size_t N>
template<typename InputIterator >
iterator std_cxx26::inplace_vector< T, N >::insert ( const_iterator  position,
InputIterator  first,
InputIterator  last 
)
inline

Construct new objects at the location of position from the iterator range defined by first and last.

Definition at line 804 of file inplace_vector.h.

◆ insert() [5/5]

template<typename T , std::size_t N>
iterator std_cxx26::inplace_vector< T, N >::insert ( const_iterator  position,
std::initializer_list< T >  init 
)
inline

Insert values from an initializer list at a position.

Definition at line 831 of file inplace_vector.h.

◆ erase() [1/2]

template<typename T , std::size_t N>
iterator std_cxx26::inplace_vector< T, N >::erase ( const_iterator  position)
inline

Erase a value.

Definition at line 840 of file inplace_vector.h.

◆ erase() [2/2]

template<typename T , std::size_t N>
iterator std_cxx26::inplace_vector< T, N >::erase ( const_iterator  first,
const_iterator  last 
)
inline

Erase a range of values.

Definition at line 855 of file inplace_vector.h.

◆ swap()

template<typename T , std::size_t N>
void std_cxx26::inplace_vector< T, N >::swap ( inplace_vector< T, N > &  other)
inlinenoexcept

Swap the contents of this vector with another.

Definition at line 874 of file inplace_vector.h.

◆ clear()

template<typename T , std::size_t N>
constexpr void std_cxx26::inplace_vector< T, N >::clear ( )
inlineconstexprnoexcept

Clear the contents of the vector.

Definition at line 913 of file inplace_vector.h.

◆ internal_resize()

template<typename T , std::size_t N>
template<bool check = false, typename... Args>
constexpr void std_cxx26::inplace_vector< T, N >::internal_resize ( const size_type  n,
Args &&...  args 
)
inlineconstexprprivatenoexcept

Common function for resizing the vector.

Definition at line 979 of file inplace_vector.h.

◆ internal_assign()

template<typename T , std::size_t N>
template<typename InputIterator , bool check = false, bool move = false>
void std_cxx26::inplace_vector< T, N >::internal_assign ( InputIterator  first,
InputIterator  last 
)
inlineprivatenoexcept

Common function for assigning values to the vector from a range of input iterators, first by copying and then by placement new.

Definition at line 1011 of file inplace_vector.h.

◆ internal_append()

template<typename T , std::size_t N>
template<typename InputIterator , bool check = false, bool move = false>
constexpr size_type std_cxx26::inplace_vector< T, N >::internal_append ( InputIterator  first,
InputIterator  last 
)
inlineconstexprprivatenoexcept

Common function for creating or moving new values at the end of the vector.

Definition at line 1038 of file inplace_vector.h.

Friends And Related Symbol Documentation

◆ swap

template<typename T , std::size_t N>
void swap ( inplace_vector< T, N > &  x,
inplace_vector< T, N > &  y 
)
friend

Friend swap function.

Definition at line 903 of file inplace_vector.h.

◆ operator==()

template<typename T , std::size_t N>
bool operator== ( const inplace_vector< T, N > &  a,
const inplace_vector< T, N > &  b 
)
related

Comparison operators. Equality operator for inplace_vector.

Definition at line 1101 of file inplace_vector.h.

◆ operator!=()

template<typename T , std::size_t N>
bool operator!= ( const inplace_vector< T, N > &  a,
const inplace_vector< T, N > &  b 
)
related

Inequality operator for inplace_vector.

Definition at line 1113 of file inplace_vector.h.

◆ operator<()

template<typename T , std::size_t N>
bool operator< ( const inplace_vector< T, N > &  a,
const inplace_vector< T, N > &  b 
)
related

Less than operator for inplace_vector.

Definition at line 1124 of file inplace_vector.h.

◆ operator>()

template<typename T , std::size_t N>
bool operator> ( const inplace_vector< T, N > &  a,
const inplace_vector< T, N > &  b 
)
related

Greater than operator for inplace_vector.

Definition at line 1137 of file inplace_vector.h.

◆ operator<=()

template<typename T , std::size_t N>
bool operator<= ( const inplace_vector< T, N > &  a,
const inplace_vector< T, N > &  b 
)
related

Less than or equal to operator for inplace_vector.

Definition at line 1148 of file inplace_vector.h.

◆ operator>=()

template<typename T , std::size_t N>
bool operator>= ( const inplace_vector< T, N > &  a,
const inplace_vector< T, N > &  b 
)
related

Greater than or equal to operator for inplace_vector.

Definition at line 1161 of file inplace_vector.h.

◆ erase()

template<typename T , std::size_t N, typename U = T>
std::size_t erase ( std_cxx26::inplace_vector< T, N > &  vec,
const U &  value 
)
related

Erase all values equal to value in vec.

Definition at line 1174 of file inplace_vector.h.

◆ erase_if()

template<typename T , std::size_t N, typename Predicate >
std::size_t erase_if ( std_cxx26::inplace_vector< T, N > &  vec,
Predicate  pred 
)
related

Erase all values which satisfy the predicate pred in vec.

Definition at line 1190 of file inplace_vector.h.

Member Data Documentation

◆ elements

template<typename T , std::size_t N>
T std_cxx26::inplace_vector< T, N >::elements[N > 0 ? N :1]

Definition at line 1072 of file inplace_vector.h.

◆ [union]

union { ... } std_cxx26::inplace_vector< T, N >

Prevent initialization of unused elements by placing the array in a union.

◆ n_elements

template<typename T , std::size_t N>
buffer_size_type std_cxx26::inplace_vector< T, N >::n_elements
private

Present number of elements in the buffer.

Definition at line 1087 of file inplace_vector.h.


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