Custom allocator for std::vector is ignored

前端 未结 2 1109
清歌不尽
清歌不尽 2021-01-04 11:14

I was trying to use a custom allocator for std::vector, but I noticed that std::vector does not need/use any of the member functions fr

2条回答
  •  粉色の甜心
    2021-01-04 11:32

    vector will rebind the allocator. As you bring it into scope from std::allocator, A::rebind::other will simply be std::allocator. So everything works fine.

提交回复
热议问题