New keyword
The new keyword is used to create heap-allocated class instances. It automatically calls a matching constructor overload of the class being instantiated. When using a custom allocator, it also allocates sufficient memory for the class before calling the constructor.
The new keyword accepts a generic parameter specifying using which allocator the object should be allocated. You can also pass a value as the generic parameter, in which case, the allocator type of the provided generic parameter is inferred, and is used to allocate the object. This is also true for when the generic parameter is a stack-allocated value: in that case, the object is allocated on the stack.
Examples
The following example allocates many instances of a vector class using different allocators.