Daily bit(e) of C++ | Implementing allocator-aware types
Daily bit(e) of C++ #298, Implementing allocator-aware types that can accept allocators and pass those along to their backing storage (or use directly).
If you work with allocators, you will want to implement allocator-aware types.
If possible, you can accept an allocator as an additional constructor argument.
If this isn't feasible, the alternative approach is to use the std::allocator_arg_t tag type as the first argument, followed by the allocator and the usual constructor arguments.