Allocator adaptor that intercepts the 'construct' calls to convert value initialization into default initialization. Written by Casey Carter (@codercasey) Taken from https://hackingcpp.com/cpp/recipe/uninitialized_numeric_array.html.
More...
#include <TVAlloc.h>
|
| template<typename U> |
| void | construct (U *ptr) noexcept(std::is_nothrow_default_constructible< U >::value) |
| template<typename U, typename... Args> |
| void | construct (U *ptr, Args &&... args) |
template<typename T, typename Alloc = std::allocator<T>>
class TVAlloc< T, Alloc >
Allocator adaptor that intercepts the 'construct' calls to convert value initialization into default initialization. Written by Casey Carter (@codercasey) Taken from https://hackingcpp.com/cpp/recipe/uninitialized_numeric_array.html.
This allows "std::vector<T>(30)" to only allocate, not initialize, the data.
Definition at line 26 of file TVAlloc.h.
◆ construct() [1/2]
template<typename T, typename Alloc = std::allocator<T>>
template<typename U>
| void TVAlloc< T, Alloc >::construct |
( |
U * | ptr | ) |
|
|
inlinenoexcept |
◆ construct() [2/2]
template<typename T, typename Alloc = std::allocator<T>>
template<typename U, typename... Args>
| void TVAlloc< T, Alloc >::construct |
( |
U * | ptr, |
|
|
Args &&... | args ) |
|
inline |
The documentation for this class was generated from the following file:
- /home/docs/trust-code/src/Kernel/Math/TVAlloc.h