Sleipnir C++ API
Loading...
Searching...
No Matches
small_vector.hpp File Reference
#include <stdint.h>
#include <algorithm>
#include <cassert>
#include <compare>
#include <concepts>
#include <cstddef>
#include <cstring>
#include <initializer_list>
#include <iterator>
#include <limits>
#include <memory>
#include <new>
#include <stdexcept>
#include <type_traits>
#include <utility>

Go to the source code of this file.

Classes

struct  sleipnir::default_buffer_size< Allocator >
 
class  sleipnir::small_vector_iterator< Pointer, DifferenceType >
 
struct  sleipnir::detail::allocator_interface< Allocator >::is_small_vector_iterator< Iterator >
 
struct  sleipnir::detail::allocator_interface< Allocator >::is_small_vector_iterator< small_vector_iterator< Ts... > >
 
struct  sleipnir::detail::allocator_interface< Allocator >::is_memcpyable_iterator< InputIt >
 
struct  sleipnir::detail::allocator_interface< Allocator >::is_memcpyable_iterator< std::move_iterator< InputIt > >
 
struct  sleipnir::detail::allocator_interface< Allocator >::is_uninitialized_memcpyable_iterator< InputIt, V >
 
struct  sleipnir::detail::allocator_interface< Allocator >::is_uninitialized_memcpyable_iterator< std::move_iterator< U >, V >
 
struct  sleipnir::detail::small_vector_base< Allocator, InlineCapacity >::bypass_tag
 
struct  sleipnir::detail::small_vector_base< Allocator, InlineCapacity >::strong_exception_policy
 
class  sleipnir::small_vector< T, InlineCapacity, Allocator >
 

Namespaces

namespace  sleipnir
 
namespace  sleipnir::concepts
 
namespace  sleipnir::concepts::small_vector
 
namespace  sleipnir::detail
 

Concepts

concept  sleipnir::concepts::Complete
 
concept  sleipnir::concepts::Destructible
 
concept  sleipnir::concepts::TriviallyDestructible
 
concept  sleipnir::concepts::NoThrowDestructible
 
concept  sleipnir::concepts::ConstructibleFrom
 
concept  sleipnir::concepts::NoThrowConstructibleFrom
 
concept  sleipnir::concepts::ConvertibleTo
 
concept  sleipnir::concepts::NoThrowConvertibleTo
 
concept  sleipnir::concepts::DefaultConstructible
 
concept  sleipnir::concepts::MoveAssignable
 
concept  sleipnir::concepts::CopyAssignable
 
concept  sleipnir::concepts::MoveConstructible
 
concept  sleipnir::concepts::NoThrowMoveConstructible
 
concept  sleipnir::concepts::CopyConstructible
 
concept  sleipnir::concepts::NoThrowCopyConstructible
 
concept  sleipnir::concepts::Swappable
 
concept  sleipnir::concepts::EqualityComparable
 
concept  sleipnir::concepts::EmplaceConstructible
 
concept  sleipnir::concepts::DefaultInsertable
 
concept  sleipnir::concepts::MoveInsertable
 
concept  sleipnir::concepts::CopyInsertable
 
concept  sleipnir::concepts::Erasable
 
concept  sleipnir::concepts::ContextuallyConvertibleToBool
 
concept  sleipnir::concepts::BoolConstant
 
concept  sleipnir::concepts::NullablePointer
 
concept  sleipnir::concepts::AllocatorFor
 
concept  sleipnir::concepts::Allocator
 
concept  sleipnir::concepts::small_vector::Destructible
 
concept  sleipnir::concepts::small_vector::MoveAssignable
 
concept  sleipnir::concepts::small_vector::CopyAssignable
 
concept  sleipnir::concepts::small_vector::MoveConstructible
 
concept  sleipnir::concepts::small_vector::CopyConstructible
 
concept  sleipnir::concepts::small_vector::Swappable
 
concept  sleipnir::concepts::small_vector::DefaultInsertable
 
concept  sleipnir::concepts::small_vector::MoveInsertable
 
concept  sleipnir::concepts::small_vector::CopyInsertable
 
concept  sleipnir::concepts::small_vector::Erasable
 
concept  sleipnir::concepts::small_vector::EmplaceConstructible
 
concept  sleipnir::concepts::small_vector::AllocatorFor
 
concept  sleipnir::concepts::small_vector::Allocator
 

Functions

template<typename PointerLHS , typename DifferenceTypeLHS , typename PointerRHS , typename DifferenceTypeRHS >
requires requires { { lhs.base() == rhs.base() } -> std::convertible_to<bool>; }
constexpr bool sleipnir::operator== (const small_vector_iterator< PointerLHS, DifferenceTypeLHS > &lhs, const small_vector_iterator< PointerRHS, DifferenceTypeRHS > &rhs) noexcept(noexcept(lhs.base()==rhs.base()))
 
template<typename Pointer , typename DifferenceType >
requires requires { { lhs.base() == rhs.base() } -> std::convertible_to<bool>; }
constexpr bool sleipnir::operator== (const small_vector_iterator< Pointer, DifferenceType > &lhs, const small_vector_iterator< Pointer, DifferenceType > &rhs) noexcept(noexcept(lhs.base()==rhs.base()))
 
template<typename PointerLHS , typename DifferenceTypeLHS , typename PointerRHS , typename DifferenceTypeRHS >
requires std::three_way_comparable_with<PointerLHS, PointerRHS>
constexpr auto sleipnir::operator<=> (const small_vector_iterator< PointerLHS, DifferenceTypeLHS > &lhs, const small_vector_iterator< PointerRHS, DifferenceTypeRHS > &rhs) noexcept(noexcept(lhs.base()<=> rhs.base()))
 
template<typename Pointer , typename DifferenceType >
requires std::three_way_comparable<Pointer>
constexpr auto sleipnir::operator<=> (const small_vector_iterator< Pointer, DifferenceType > &lhs, const small_vector_iterator< Pointer, DifferenceType > &rhs) noexcept(noexcept(lhs.base()<=> rhs.base()))
 
template<typename PointerLHS , typename DifferenceTypeLHS , typename PointerRHS , typename DifferenceTypeRHS >
constexpr auto sleipnir::operator<=> (const small_vector_iterator< PointerLHS, DifferenceTypeLHS > &lhs, const small_vector_iterator< PointerRHS, DifferenceTypeRHS > &rhs) noexcept(noexcept(lhs.base()< rhs.base()) &&noexcept(rhs.base()< lhs.base()))
 
template<typename Pointer , typename DifferenceType >
constexpr auto sleipnir::operator<=> (const small_vector_iterator< Pointer, DifferenceType > &lhs, const small_vector_iterator< Pointer, DifferenceType > &rhs) noexcept(noexcept(lhs.base()< rhs.base()) &&noexcept(rhs.base()< lhs.base()))
 
template<typename PointerLHS , typename PointerRHS , typename DifferenceType >
constexpr DifferenceType sleipnir::operator- (const small_vector_iterator< PointerLHS, DifferenceType > &lhs, const small_vector_iterator< PointerRHS, DifferenceType > &rhs) noexcept
 
template<typename Pointer , typename DifferenceType >
constexpr DifferenceType sleipnir::operator- (const small_vector_iterator< Pointer, DifferenceType > &lhs, const small_vector_iterator< Pointer, DifferenceType > &rhs) noexcept
 
template<typename Pointer , typename DifferenceType >
constexpr small_vector_iterator< Pointer, DifferenceTypesleipnir::operator+ (DifferenceType n, const small_vector_iterator< Pointer, DifferenceType > &it) noexcept
 
template<typename T , unsigned InlineCapacityLHS, unsigned InlineCapacityRHS, typename Allocator >
constexpr bool sleipnir::operator== (const small_vector< T, InlineCapacityLHS, Allocator > &lhs, const small_vector< T, InlineCapacityRHS, Allocator > &rhs)
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr bool sleipnir::operator== (const small_vector< T, InlineCapacity, Allocator > &lhs, const small_vector< T, InlineCapacity, Allocator > &rhs)
 
template<typename T , unsigned InlineCapacityLHS, unsigned InlineCapacityRHS, typename Allocator >
requires std::three_way_comparable<T>
constexpr auto sleipnir::operator<=> (const small_vector< T, InlineCapacityLHS, Allocator > &lhs, const small_vector< T, InlineCapacityRHS, Allocator > &rhs)
 
template<typename T , unsigned InlineCapacity, typename Allocator >
requires std::three_way_comparable<T>
constexpr auto sleipnir::operator<=> (const small_vector< T, InlineCapacity, Allocator > &lhs, const small_vector< T, InlineCapacity, Allocator > &rhs)
 
template<typename T , unsigned InlineCapacityLHS, unsigned InlineCapacityRHS, typename Allocator >
constexpr auto sleipnir::operator<=> (const small_vector< T, InlineCapacityLHS, Allocator > &lhs, const small_vector< T, InlineCapacityRHS, Allocator > &rhs)
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr auto sleipnir::operator<=> (const small_vector< T, InlineCapacity, Allocator > &lhs, const small_vector< T, InlineCapacity, Allocator > &rhs)
 
template<typename T , unsigned InlineCapacity, typename Allocator >
requires concepts::MoveInsertable< T, small_vector<T, InlineCapacity, Allocator>, Allocator> && concepts::Swappable<T>
constexpr void sleipnir::swap (small_vector< T, InlineCapacity, Allocator > &lhs, small_vector< T, InlineCapacity, Allocator > &rhs) noexcept(noexcept(lhs.swap(rhs)))
 
template<typename T , unsigned InlineCapacity, typename Allocator , typename U >
constexpr small_vector< T, InlineCapacity, Allocator >::size_type sleipnir::erase (small_vector< T, InlineCapacity, Allocator > &v, const U &value)
 
template<typename T , unsigned InlineCapacity, typename Allocator , typename Pred >
constexpr small_vector< T, InlineCapacity, Allocator >::size_type sleipnir::erase_if (small_vector< T, InlineCapacity, Allocator > &v, Pred pred)
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::iterator sleipnir::begin (small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::const_iterator sleipnir::begin (const small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::const_iterator sleipnir::cbegin (const small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::iterator sleipnir::end (small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::const_iterator sleipnir::end (const small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::const_iterator sleipnir::cend (const small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::reverse_iterator sleipnir::rbegin (small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::const_reverse_iterator sleipnir::rbegin (const small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::const_reverse_iterator sleipnir::crbegin (const small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::reverse_iterator sleipnir::rend (small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::const_reverse_iterator sleipnir::rend (const small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::const_reverse_iterator sleipnir::crend (const small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::size_type sleipnir::size (const small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr std::common_type_t< std::ptrdiff_t, typename std::make_signed_t< typename small_vector< T, InlineCapacity, Allocator >::size_type > > sleipnir::ssize (const small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr bool sleipnir::empty (const small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::pointer sleipnir::data (small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename T , unsigned InlineCapacity, typename Allocator >
constexpr small_vector< T, InlineCapacity, Allocator >::const_pointer sleipnir::data (const small_vector< T, InlineCapacity, Allocator > &v) noexcept
 
template<typename InputIt , unsigned InlineCapacity = default_buffer_size_v< std::allocator<typename std::iterator_traits<InputIt>::value_type>>, typename Allocator = std::allocator<typename std::iterator_traits<InputIt>::value_type>>
 sleipnir::small_vector (InputIt, InputIt, Allocator=Allocator()) -> small_vector< typename std::iterator_traits< InputIt >::value_type, InlineCapacity, Allocator >
 

Variables

template<typename Allocator >
constexpr unsigned sleipnir::default_buffer_size_v