问题描述
假设不希望有一个状态分配器并创建一个副本,我认为必须通过引用(提供给任何给定的struct或class)来提供它,所以:
element_allocator_type &allocator = supplied_allocator;
一个人如何将这个分配器引用重新绑定到另一种类型而又不失去其有状态性,即。没有创建副本?实际上我们可以这样做吗?如果:
typedef typename std::allocator_traits<element_allocator_type>::template rebind_alloc<unsigned char> uchar_allocator_type;
(例如)是我们重新绑定到的类型,创建重新绑定的分配器引用的行是什么?
uchar_allocator_type &rebound_allocator = ???
干杯-
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)