MySQL 8.4.2
Source Code Documentation
default_init_allocator< T, A > Class Template Reference

allocator which leaves newly constructed fields "default initialized". More...

#include <default_init_allocator.h>

Inheritance diagram for default_init_allocator< T, A >:
[legend]

Classes

struct  rebind
 

Public Member Functions

template<class U >
void construct (U *ptr) noexcept(std::is_nothrow_default_constructible< U >::value)
 
template<class U , class... Args>
void construct (U *ptr, Args &&... args)
 

Private Types

using a_t = std::allocator_traits< A >
 

Detailed Description

template<class T, class A = std::allocator<T>>
class default_init_allocator< T, A >

allocator which leaves newly constructed fields "default initialized".

in case of std::vector<int> after a resize() the newly added fields would be uninitialized.

useful in case of network-buffers it will be read() into right afterwards.

Member Typedef Documentation

◆ a_t

template<class T , class A = std::allocator<T>>
using default_init_allocator< T, A >::a_t = std::allocator_traits<A>
private

Member Function Documentation

◆ construct() [1/2]

template<class T , class A = std::allocator<T>>
template<class U >
void default_init_allocator< T, A >::construct ( U ptr)
inlinenoexcept

◆ construct() [2/2]

template<class T , class A = std::allocator<T>>
template<class U , class... Args>
void default_init_allocator< T, A >::construct ( U ptr,
Args &&...  args 
)
inline

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