NumericAL
A header-only C++20 lexer built on REAL
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
numerical::detail::default_init_allocator< T > Struct Template Reference

The allocator of numerical::buffer. An element constructed with no value is default-initialised, so a double keeps whatever its memory held, where std::allocator zeroes it; one constructed with a value is constructed from it. A result written in full is then written once, by the threads that compute it, not zeroed first on one of them (a product of order 512 on eight arm64 threads spent a fifth of its time in that zeroing). More...

#include <buffer.hpp>

Inheritance diagram for numerical::detail::default_init_allocator< T >:
[legend]
Collaboration diagram for numerical::detail::default_init_allocator< T >:
[legend]

Classes

struct  rebind
 The allocator of another element type, as std::allocator_traits rebinds it. More...
 

Public Types

using value_type = T
 The element type.
 

Public Member Functions

 default_init_allocator () noexcept=default
 
template<typename U >
false default_init_allocator (const default_init_allocator< U > &) noexcept
 From the allocator of another element type: stateless, as std::allocator.
 
template<typename U >
void construct (U *at) noexcept(std::is_nothrow_default_constructible_v< U >)
 Default-initialises the element at at.
 
template<typename U , typename ... Args>
void construct (U *at, Args &&... args)
 Constructs the element at at from args.
 

Detailed Description

template<typename T>
struct numerical::detail::default_init_allocator< T >

The allocator of numerical::buffer. An element constructed with no value is default-initialised, so a double keeps whatever its memory held, where std::allocator zeroes it; one constructed with a value is constructed from it. A result written in full is then written once, by the threads that compute it, not zeroed first on one of them (a product of order 512 on eight arm64 threads spent a fifth of its time in that zeroing).

Definition at line 35 of file buffer.hpp.

Member Typedef Documentation

◆ value_type

The element type.

Definition at line 37 of file buffer.hpp.

Constructor & Destructor Documentation

◆ default_init_allocator() [1/2]

template<typename T >
numerical::detail::default_init_allocator< T >::default_init_allocator ( )
defaultnoexcept

◆ default_init_allocator() [2/2]

template<typename T >
template<typename U >
false numerical::detail::default_init_allocator< T >::default_init_allocator ( const default_init_allocator< U > &  )
inlineexplicitnoexcept

From the allocator of another element type: stateless, as std::allocator.

Definition at line 51 of file buffer.hpp.

Member Function Documentation

◆ construct() [1/2]

template<typename T >
template<typename U >
void numerical::detail::default_init_allocator< T >::construct ( U *  at)
inlinenoexcept

Default-initialises the element at at.

Definition at line 124 of file buffer.hpp.

◆ construct() [2/2]

template<typename T >
template<typename U , typename ... Args>
void numerical::detail::default_init_allocator< T >::construct ( U *  at,
Args &&...  args 
)
inline

Constructs the element at at from args.

Definition at line 132 of file buffer.hpp.


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