Is it possible to use custom allocator for std::vector
internal allocations? If yes, how?
You basically have to implement your allocator type to conform to the Allocator concept .
The linked page lists all requirements of that type, but the core functionality is implemented in the allocate
member function.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.