Using custom allocator for boost::wregex

 ̄綄美尐妖づ 提交于 2019-12-24 19:09:16

问题


I created a custom allocator and want to use it all across our code. The way we did it is by defining the templates that wrap each containers we use and make use of our own allocator instead of the default:

template <class Type> class myVector : public std::vector<Type, CCustomAllocator<Type>>

and so we can use it in our code like this:myVector<int> x. This reduces the chance of making mistakes.

we have similar wrappers for all the containers we use in our code: list, string, wstring, ...

I hope this approach makes sense.

I am having trouble defining this type of template wrapper for boost::wregex. Can regex use a specified allocator?

来源:https://stackoverflow.com/questions/8248076/using-custom-allocator-for-boostwregex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!