Spicy
Classes | Public Types | Public Member Functions | List of all members
hilti::rt::vector::Allocator< T, Default_ > Class Template Reference

#include <vector.h>

Classes

struct  rebind
 

Public Types

using value_type = T
 

Public Member Functions

value_type * allocate (std::size_t n)
 
void deallocate (value_type *p, std::size_t) noexcept
 
template<typename U >
void construct (U *p) noexcept(std::is_nothrow_default_constructible< U >::value)
 
template<typename U , typename... Args>
void construct (U *p, Args &&... args)
 

Detailed Description

template<class T, decltype(auto) Default_>
class hilti::rt::vector::Allocator< T, Default_ >

Allocator for Vector that initializes elements with a given default value.

See https://howardhinnant.github.io/allocator_boilerplate.html and https://stackoverflow.com/questions/48061522/create-the-simplest-allocator-with-two-template-arguments

We allow defaults with types differing from the allocated type (but implicitly convertible to it) to support allocators over non-basic types, see e.g., https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1907r1.html.


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