![]() |
|
Vdf_DefaultInitAllocator. More...
#include <defaultInitAllocator.h>
Inherits allocator< T >.
Public Member Functions | |
| template<typename U > | |
| void | construct (U *ptr) noexcept(std::is_nothrow_default_constructible_v< U >) |
| Value initializing construction. | |
| template<typename U , typename... Args> | |
| void | construct (U *ptr, Args &&... args) |
| Construction with custom constructor arguments. | |
This allocator intercepts value initialization and turns it into default initialization. It's primary purpose is for use on containers, such as std::vector, that are first resized and then immediately filled with elements. Without the use of this allocator, the resize would value-initialize every element before immediately overwriting the element when it's filled in.
Definition at line 27 of file defaultInitAllocator.h.
|
inlinenoexcept |
Value initializing construction.
This method instead default initializes instances of U.
Definition at line 46 of file defaultInitAllocator.h.
|
inline |
Construction with custom constructor arguments.
This method simply forwards any arguments to the U constructor.
Definition at line 56 of file defaultInitAllocator.h.