Custom allocator in std::vector

后端 未结 1 1133
猫巷女王i
猫巷女王i 2020-12-29 04:24

Is it possible to use custom allocator for std::vector internal allocations? If yes, how?

相关标签:
1条回答
  • 2020-12-29 05:04

    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.

    0 讨论(0)
提交回复
热议问题