Gromacs  2021-beta2-UNCHECKED
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::DefaultInitializationAllocator< T, A > Class Template Reference

#include <gromacs/utility/defaultinitializationallocator.h>

Inherits A.


template<typename T, typename A = std::allocator<T>>
class gmx::DefaultInitializationAllocator< T, A >

Allocator adaptor that interposes construct() calls to convert value initialization into default initialization.

This can be used to avoid initialization e.g. on resize() in std::vector.

Public Member Functions

template<typename U >
void construct (U *ptr) noexcept(std::is_nothrow_default_constructible< U >::value)
 Constructs an object and default initializes. More...
template<typename U , typename... Args>
void construct (U *ptr, Args &&...args)
 Constructs an object and value initializes.

Member Function Documentation

template<typename T , typename A = std::allocator<T>>
template<typename U >
void gmx::DefaultInitializationAllocator< T, A >::construct ( U *  ptr)

Constructs an object and default initializes.

Use std::is_nothrow_default_constructible_v when CUDA 11 is a requirement.

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