xtd 0.2.0
Loading...
Searching...
No Matches

◆ allocator

template<typename type_t >
using xtd::collections::generic::helpers::allocator = typedef std::allocator<type_t>

Represent an allocator alias.

Header
#include <xtd/collections/generic/allocator>
Namespace
xtd::collections
Library
xtd.core
Remarks
The xtd::collections::generic::helpers::allocator is the default allocator used by all xtd library containers if no user-specified allocator is provided.
The xtd::collections::generic::helpers::allocator is alias on std::allocator.
A simple alias for the moment, which leaves open the possibility of implementing a specific allocator for xtd if necessary in the future.
Examples
The following example show how to use xtd::collections::generic::helpers::allocator with std::vector.
auto values = std::vector<date_time, xtd::collections::generic::helpers::allocator<date_time>> {};
values.emplace_back(1971, 1, 5);