sparrow 0.9.0
Loading...
Searching...
No Matches
sparrow::buffer_adaptor< To, FromBufferRef > Class Template Reference

Class which has internally a reference to a contiguous container of a certain type and provides an API to access it as if it was a buffer<T>. More...

#include <buffer_adaptor.hpp>

Inheritance diagram for sparrow::buffer_adaptor< To, FromBufferRef >:
[legend]
Collaboration diagram for sparrow::buffer_adaptor< To, FromBufferRef >:
[legend]

Public Types

using value_type = To
 
using reference = value_type&
 
using const_reference = const value_type&
 
using pointer = value_type*
 
using const_pointer = const value_type*
 
using buffer_reference_value_type = std::remove_cvref_t<FromBufferRef>::value_type
 
using buffer_reference = std::conditional_t<is_const, const FromBufferRef, FromBufferRef>
 
using size_type = std::remove_cvref_t<buffer_reference>::size_type
 
using difference_type = std::remove_cvref_t<buffer_reference>::difference_type
 
using iterator = pointer_iterator<pointer>
 
using const_iterator = pointer_iterator<const_pointer>
 
using reverse_iterator = std::reverse_iterator<iterator>
 
using const_reverse_iterator = std::reverse_iterator<const_iterator>
 

Public Member Functions

constexpr buffer_adaptor (FromBufferRef buf)
 Constructs a buffer adaptor with a non-const buffer reference.
 
constexpr buffer_adaptor (const FromBufferRef buf)
 Constructs a buffer adaptor with a const buffer reference.
 
constexpr pointer data () noexcept
 Returns a pointer to the underlying data.
 
constexpr const_pointer data () const noexcept
 Returns a constant pointer to the underlying data.
 
constexpr reference operator[] (size_type idx)
 Returns a reference to the element at the specified index.
 
constexpr const_reference operator[] (size_type idx) const
 Returns a constant reference to the element at the specified index.
 
constexpr reference front ()
 Returns a reference to the first element.
 
constexpr const_reference front () const
 Returns a constant reference to the first element.
 
constexpr reference back ()
 Returns a reference to the last element.
 
constexpr const_reference back () const
 Returns a constant reference to the last element.
 
constexpr iterator begin () noexcept
 Returns an iterator to the beginning.
 
constexpr iterator end () noexcept
 Returns an iterator to the end.
 
constexpr const_iterator begin () const noexcept
 Returns a constant iterator to the beginning.
 
constexpr const_iterator end () const noexcept
 Returns a constant iterator to the end.
 
constexpr const_iterator cbegin () const noexcept
 Returns a constant iterator to the beginning.
 
constexpr const_iterator cend () const noexcept
 Returns a constant iterator to the end.
 
constexpr reverse_iterator rbegin () noexcept
 Returns a reverse iterator to the beginning.
 
constexpr reverse_iterator rend () noexcept
 Returns a reverse iterator to the end.
 
constexpr const_reverse_iterator rbegin () const noexcept
 Returns a constant reverse iterator to the beginning.
 
constexpr const_reverse_iterator rend () const noexcept
 Returns a constant reverse iterator to the end.
 
constexpr const_reverse_iterator crbegin () const noexcept
 Returns a constant reverse iterator to the beginning.
 
constexpr const_reverse_iterator crend () const noexcept
 Returns a constant reverse iterator to the end.
 
constexpr size_type size () const noexcept(!SPARROW_CONTRACTS_THROW_ON_FAILURE)
 Returns the number of elements that can be held in currently allocated storage.
 
constexpr size_type max_size () const noexcept
 Returns the maximum possible number of elements.
 
constexpr size_type capacity () const noexcept
 Returns the number of elements that can be held in currently allocated storage.
 
constexpr bool empty () const noexcept
 Checks whether the container is empty.
 
constexpr void reserve (size_type new_cap)
 Reserves storage for at least the specified number of elements.
 
constexpr void shrink_to_fit ()
 Requests the removal of unused capacity.
 
constexpr void clear () noexcept
 Clears the contents.
 
constexpr iterator insert (const_iterator pos, const value_type &value)
 Inserts an element at the specified position.
 
constexpr iterator insert (const_iterator pos, size_type count, const value_type &value)
 Inserts multiple copies of an element at the specified position.
 
template<class InputIt>
requires std::input_iterator<InputIt> (not is_const)
constexpr iterator insert (const_iterator pos, InputIt first, InputIt last)
 Inserts elements from a range at the specified position.
 
constexpr iterator insert (const_iterator pos, std::initializer_list< value_type > ilist)
 Inserts elements from an initializer list at the specified position.
 
template<class... Args>
requires (not is_const)
constexpr iterator emplace (const_iterator pos, Args &&... args)
 Constructs an element in-place at the specified position.
 
constexpr iterator erase (const_iterator pos)
 Erases an element at the specified position.
 
constexpr iterator erase (const_iterator first, const_iterator last)
 Erases elements in the specified range.
 
constexpr void push_back (const value_type &value)
 Adds an element to the end.
 
constexpr void pop_back ()
 Removes the last element.
 
constexpr void resize (size_type new_size)
 Changes the number of elements stored.
 
constexpr void resize (size_type new_size, const value_type &value)
 Changes the number of elements stored, filling new elements with the specified value.
 

Static Public Attributes

static constexpr bool is_const = std::is_const_v<To>
 

Detailed Description

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
class sparrow::buffer_adaptor< To, FromBufferRef >

Class which has internally a reference to a contiguous container of a certain type and provides an API to access it as if it was a buffer<T>.

Template Parameters
ToThe type to which the buffer will be adapted. The size of the type To must be equal or bigger than the element type of the container.
FromBufferRefThe type of the container to adapt. If it's a const reference, all non-const methods are disabled.

Definition at line 57 of file buffer_adaptor.hpp.

Member Typedef Documentation

◆ buffer_reference

template<typename To, BufferReference< To > FromBufferRef>
using sparrow::buffer_adaptor< To, FromBufferRef >::buffer_reference = std::conditional_t<is_const, const FromBufferRef, FromBufferRef>

Definition at line 69 of file buffer_adaptor.hpp.

◆ buffer_reference_value_type

template<typename To, BufferReference< To > FromBufferRef>
using sparrow::buffer_adaptor< To, FromBufferRef >::buffer_reference_value_type = std::remove_cvref_t<FromBufferRef>::value_type

Definition at line 68 of file buffer_adaptor.hpp.

◆ const_iterator

template<typename To, BufferReference< To > FromBufferRef>
using sparrow::buffer_adaptor< To, FromBufferRef >::const_iterator = pointer_iterator<const_pointer>

Definition at line 74 of file buffer_adaptor.hpp.

◆ const_pointer

template<typename To, BufferReference< To > FromBufferRef>
using sparrow::buffer_adaptor< To, FromBufferRef >::const_pointer = const value_type*

Definition at line 65 of file buffer_adaptor.hpp.

◆ const_reference

template<typename To, BufferReference< To > FromBufferRef>
using sparrow::buffer_adaptor< To, FromBufferRef >::const_reference = const value_type&

Definition at line 63 of file buffer_adaptor.hpp.

◆ const_reverse_iterator

template<typename To, BufferReference< To > FromBufferRef>
using sparrow::buffer_adaptor< To, FromBufferRef >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 76 of file buffer_adaptor.hpp.

◆ difference_type

template<typename To, BufferReference< To > FromBufferRef>
using sparrow::buffer_adaptor< To, FromBufferRef >::difference_type = std::remove_cvref_t<buffer_reference>::difference_type

Definition at line 72 of file buffer_adaptor.hpp.

◆ iterator

template<typename To, BufferReference< To > FromBufferRef>
using sparrow::buffer_adaptor< To, FromBufferRef >::iterator = pointer_iterator<pointer>

Definition at line 73 of file buffer_adaptor.hpp.

◆ pointer

template<typename To, BufferReference< To > FromBufferRef>
using sparrow::buffer_adaptor< To, FromBufferRef >::pointer = value_type*

Definition at line 64 of file buffer_adaptor.hpp.

◆ reference

template<typename To, BufferReference< To > FromBufferRef>
using sparrow::buffer_adaptor< To, FromBufferRef >::reference = value_type&

Definition at line 62 of file buffer_adaptor.hpp.

◆ reverse_iterator

template<typename To, BufferReference< To > FromBufferRef>
using sparrow::buffer_adaptor< To, FromBufferRef >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 75 of file buffer_adaptor.hpp.

◆ size_type

template<typename To, BufferReference< To > FromBufferRef>
using sparrow::buffer_adaptor< To, FromBufferRef >::size_type = std::remove_cvref_t<buffer_reference>::size_type

Definition at line 71 of file buffer_adaptor.hpp.

◆ value_type

template<typename To, BufferReference< To > FromBufferRef>
using sparrow::buffer_adaptor< To, FromBufferRef >::value_type = To

Definition at line 61 of file buffer_adaptor.hpp.

Constructor & Destructor Documentation

◆ buffer_adaptor() [1/2]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
sparrow::buffer_adaptor< To, FromBufferRef >::buffer_adaptor ( FromBufferRef buf)
explicitconstexpr

Constructs a buffer adaptor with a non-const buffer reference.

Parameters
bufThe buffer reference to adapt.

Definition at line 461 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ buffer_adaptor() [2/2]

template<typename To, BufferReference< To > FromBufferRef>
sparrow::buffer_adaptor< To, FromBufferRef >::buffer_adaptor ( const FromBufferRef buf)
explicitconstexpr

Constructs a buffer adaptor with a const buffer reference.

Parameters
bufThe const buffer reference to adapt.

Member Function Documentation

◆ back() [1/2]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
buffer_adaptor< To, FromBufferRef >::reference sparrow::buffer_adaptor< To, FromBufferRef >::back ( )
nodiscardconstexpr

Returns a reference to the last element.

Returns
Reference to the last element.

Definition at line 532 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ back() [2/2]

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::const_reference sparrow::buffer_adaptor< To, FromBufferRef >::back ( ) const
nodiscardconstexpr

Returns a constant reference to the last element.

Returns
Constant reference to the last element.

Definition at line 542 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ begin() [1/2]

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::const_iterator sparrow::buffer_adaptor< To, FromBufferRef >::begin ( ) const
nodiscardconstexprnoexcept

Returns a constant iterator to the beginning.

Returns
Constant iterator to the beginning.

Definition at line 569 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ begin() [2/2]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
buffer_adaptor< To, FromBufferRef >::iterator sparrow::buffer_adaptor< To, FromBufferRef >::begin ( )
nodiscardconstexprnoexcept

Returns an iterator to the beginning.

Returns
Iterator to the beginning.

Definition at line 551 of file buffer_adaptor.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ capacity()

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::size_type sparrow::buffer_adaptor< To, FromBufferRef >::capacity ( ) const
nodiscardconstexprnoexcept

Returns the number of elements that can be held in currently allocated storage.

Returns
The capacity.

Definition at line 674 of file buffer_adaptor.hpp.

◆ cbegin()

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::const_iterator sparrow::buffer_adaptor< To, FromBufferRef >::cbegin ( ) const
nodiscardconstexprnoexcept

Returns a constant iterator to the beginning.

Returns
Constant iterator to the beginning.

Definition at line 585 of file buffer_adaptor.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cend()

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::const_iterator sparrow::buffer_adaptor< To, FromBufferRef >::cend ( ) const
nodiscardconstexprnoexcept

Returns a constant iterator to the end.

Returns
Constant iterator to the end.

Definition at line 593 of file buffer_adaptor.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
void sparrow::buffer_adaptor< To, FromBufferRef >::clear ( )
constexprnoexcept

Clears the contents.

Definition at line 706 of file buffer_adaptor.hpp.

◆ crbegin()

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::const_reverse_iterator sparrow::buffer_adaptor< To, FromBufferRef >::crbegin ( ) const
nodiscardconstexprnoexcept

Returns a constant reverse iterator to the beginning.

Returns
Constant reverse iterator to the beginning.

Definition at line 635 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ crend()

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::const_reverse_iterator sparrow::buffer_adaptor< To, FromBufferRef >::crend ( ) const
nodiscardconstexprnoexcept

Returns a constant reverse iterator to the end.

Returns
Constant reverse iterator to the end.

Definition at line 643 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ data() [1/2]

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::const_pointer sparrow::buffer_adaptor< To, FromBufferRef >::data ( ) const
nodiscardconstexprnoexcept

Returns a constant pointer to the underlying data.

Returns
Constant pointer to the data.

Definition at line 488 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ data() [2/2]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
buffer_adaptor< To, FromBufferRef >::pointer sparrow::buffer_adaptor< To, FromBufferRef >::data ( )
nodiscardconstexprnoexcept

Returns a pointer to the underlying data.

Returns
Pointer to the data.

Definition at line 479 of file buffer_adaptor.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ emplace()

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
template<class... Args>
requires (not is_const)
buffer_adaptor< To, FromBufferRef >::iterator sparrow::buffer_adaptor< To, FromBufferRef >::emplace ( const_iterator pos,
Args &&... args )
constexpr

Constructs an element in-place at the specified position.

Template Parameters
ArgsThe argument types.
Parameters
posThe position to emplace at.
argsArguments to forward to the constructor.
Returns
Iterator pointing to the emplaced element.

Definition at line 776 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ empty()

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
bool sparrow::buffer_adaptor< To, FromBufferRef >::empty ( ) const
nodiscardconstexprnoexcept

Checks whether the container is empty.

Returns
true if the container is empty, false otherwise.

Definition at line 681 of file buffer_adaptor.hpp.

Here is the caller graph for this function:

◆ end() [1/2]

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::const_iterator sparrow::buffer_adaptor< To, FromBufferRef >::end ( ) const
nodiscardconstexprnoexcept

Returns a constant iterator to the end.

Returns
Constant iterator to the end.

Definition at line 577 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ end() [2/2]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
buffer_adaptor< To, FromBufferRef >::iterator sparrow::buffer_adaptor< To, FromBufferRef >::end ( )
nodiscardconstexprnoexcept

Returns an iterator to the end.

Returns
Iterator to the end.

Definition at line 560 of file buffer_adaptor.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ erase() [1/2]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
buffer_adaptor< To, FromBufferRef >::iterator sparrow::buffer_adaptor< To, FromBufferRef >::erase ( const_iterator first,
const_iterator last )
constexpr

Erases elements in the specified range.

Parameters
firstThe beginning of the range to erase.
lastThe end of the range to erase.
Returns
Iterator following the last element removed.

Definition at line 814 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ erase() [2/2]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
buffer_adaptor< To, FromBufferRef >::iterator sparrow::buffer_adaptor< To, FromBufferRef >::erase ( const_iterator pos)
constexpr

Erases an element at the specified position.

Parameters
posThe position of the element to erase.
Returns
Iterator following the last element removed.

Definition at line 791 of file buffer_adaptor.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ front() [1/2]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
buffer_adaptor< To, FromBufferRef >::reference sparrow::buffer_adaptor< To, FromBufferRef >::front ( )
nodiscardconstexpr

Returns a reference to the first element.

Returns
Reference to the first element.

Definition at line 514 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ front() [2/2]

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::const_reference sparrow::buffer_adaptor< To, FromBufferRef >::front ( ) const
nodiscardconstexpr

Returns a constant reference to the first element.

Returns
Constant reference to the first element.

Definition at line 524 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ insert() [1/4]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
buffer_adaptor< To, FromBufferRef >::iterator sparrow::buffer_adaptor< To, FromBufferRef >::insert ( const_iterator pos,
const value_type & value )
constexpr

Inserts an element at the specified position.

Parameters
posThe position to insert at.
valueThe value to insert.
Returns
Iterator pointing to the inserted element.

Definition at line 715 of file buffer_adaptor.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insert() [2/4]

template<typename To, BufferReference< To > FromBufferRef>
requires std::input_iterator<InputIt> (not is_const)
template<class InputIt>
requires std::input_iterator<InputIt> (not is_const)
buffer_adaptor< To, FromBufferRef >::iterator sparrow::buffer_adaptor< To, FromBufferRef >::insert ( const_iterator pos,
InputIt first,
InputIt last )
constexpr

Inserts elements from a range at the specified position.

Template Parameters
InputItThe iterator type.
Parameters
posThe position to insert at.
firstThe beginning of the range to insert.
lastThe end of the range to insert.
Returns
Iterator pointing to the first inserted element.

Definition at line 750 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ insert() [3/4]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
buffer_adaptor< To, FromBufferRef >::iterator sparrow::buffer_adaptor< To, FromBufferRef >::insert ( const_iterator pos,
size_type count,
const value_type & value )
constexpr

Inserts multiple copies of an element at the specified position.

Parameters
posThe position to insert at.
countThe number of elements to insert.
valueThe value to insert.
Returns
Iterator pointing to the first inserted element.

Definition at line 730 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ insert() [4/4]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
buffer_adaptor< To, FromBufferRef >::iterator sparrow::buffer_adaptor< To, FromBufferRef >::insert ( const_iterator pos,
std::initializer_list< value_type > ilist )
constexpr

Inserts elements from an initializer list at the specified position.

Parameters
posThe position to insert at.
ilistThe initializer list to insert.
Returns
Iterator pointing to the first inserted element.

Definition at line 766 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ max_size()

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::size_type sparrow::buffer_adaptor< To, FromBufferRef >::max_size ( ) const
nodiscardconstexprnoexcept

Returns the maximum possible number of elements.

Returns
The maximum possible number of elements.

Definition at line 666 of file buffer_adaptor.hpp.

Here is the caller graph for this function:

◆ operator[]() [1/2]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
buffer_adaptor< To, FromBufferRef >::reference sparrow::buffer_adaptor< To, FromBufferRef >::operator[] ( size_type idx)
nodiscardconstexpr

Returns a reference to the element at the specified index.

Parameters
idxThe index of the element.
Returns
Reference to the element.

Definition at line 496 of file buffer_adaptor.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator[]() [2/2]

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::const_reference sparrow::buffer_adaptor< To, FromBufferRef >::operator[] ( size_type idx) const
nodiscardconstexpr

Returns a constant reference to the element at the specified index.

Parameters
idxThe index of the element.
Returns
Constant reference to the element.

Definition at line 506 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ pop_back()

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
void sparrow::buffer_adaptor< To, FromBufferRef >::pop_back ( )
constexpr

Removes the last element.

Definition at line 846 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ push_back()

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
void sparrow::buffer_adaptor< To, FromBufferRef >::push_back ( const value_type & value)
constexpr

Adds an element to the end.

Parameters
valueThe value to add.

Definition at line 838 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ rbegin() [1/2]

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::const_reverse_iterator sparrow::buffer_adaptor< To, FromBufferRef >::rbegin ( ) const
nodiscardconstexprnoexcept

Returns a constant reverse iterator to the beginning.

Returns
Constant reverse iterator to the beginning.

Definition at line 619 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ rbegin() [2/2]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
buffer_adaptor< To, FromBufferRef >::reverse_iterator sparrow::buffer_adaptor< To, FromBufferRef >::rbegin ( )
nodiscardconstexprnoexcept

Returns a reverse iterator to the beginning.

Returns
Reverse iterator to the beginning.

Definition at line 601 of file buffer_adaptor.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rend() [1/2]

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::const_reverse_iterator sparrow::buffer_adaptor< To, FromBufferRef >::rend ( ) const
nodiscardconstexprnoexcept

Returns a constant reverse iterator to the end.

Returns
Constant reverse iterator to the end.

Definition at line 627 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ rend() [2/2]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
buffer_adaptor< To, FromBufferRef >::reverse_iterator sparrow::buffer_adaptor< To, FromBufferRef >::rend ( )
nodiscardconstexprnoexcept

Returns a reverse iterator to the end.

Returns
Reverse iterator to the end.

Definition at line 610 of file buffer_adaptor.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reserve()

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
void sparrow::buffer_adaptor< To, FromBufferRef >::reserve ( size_type new_cap)
constexpr

Reserves storage for at least the specified number of elements.

Parameters
new_capThe new capacity.

Definition at line 688 of file buffer_adaptor.hpp.

◆ resize() [1/2]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
void sparrow::buffer_adaptor< To, FromBufferRef >::resize ( size_type new_size)
constexpr

Changes the number of elements stored.

Parameters
new_sizeThe new size.

Definition at line 854 of file buffer_adaptor.hpp.

◆ resize() [2/2]

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
void sparrow::buffer_adaptor< To, FromBufferRef >::resize ( size_type new_size,
const value_type & value )
constexpr

Changes the number of elements stored, filling new elements with the specified value.

Parameters
new_sizeThe new size.
valueThe value to fill new elements with.

Definition at line 865 of file buffer_adaptor.hpp.

Here is the call graph for this function:

◆ shrink_to_fit()

template<typename To, BufferReference< To > FromBufferRef>
requires (not is_const)
void sparrow::buffer_adaptor< To, FromBufferRef >::shrink_to_fit ( )
constexpr

Requests the removal of unused capacity.

Definition at line 696 of file buffer_adaptor.hpp.

◆ size()

template<typename To, BufferReference< To > FromBufferRef>
requires T_is_const_if_FromBufferRef_is_const<FromBufferRef, To>
buffer_adaptor< To, FromBufferRef >::size_type sparrow::buffer_adaptor< To, FromBufferRef >::size ( ) const
nodiscardconstexprnoexcept

Returns the number of elements that can be held in currently allocated storage.

Returns
The capacity.

Definition at line 653 of file buffer_adaptor.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ is_const

template<typename To, BufferReference< To > FromBufferRef>
bool sparrow::buffer_adaptor< To, FromBufferRef >::is_const = std::is_const_v<To>
staticconstexpr

Definition at line 66 of file buffer_adaptor.hpp.


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