template class T
using MyAllocatorVector = std::vector<T, MyAllocator<T>>;
MyAllocatorVector<int> data;
禁止使用std::move操作const对象
本文探讨了C++中模板别名的使用,并特别指出在处理const对象时,为何禁止使用std::move以防止意外修改const状态。
template class T
using MyAllocatorVector = std::vector<T, MyAllocator<T>>;
MyAllocatorVector<int> data;
禁止使用std::move操作const对象
783

被折叠的 条评论
为什么被折叠?