Converting between vectors with different allocators

前端 未结 3 826
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-08 09:33

I have written a simple C++11 style stateful allocator type. Given

template class my_allocator {
   // the usual stuff
};

template

        
3条回答
  •  难免孤独
    2021-02-08 10:30

    Hmm, I think your only option here is full copy like:

    std::vector y( x.begin(), x.end());
    

提交回复
热议问题