I'd like to persist collection with data (unordered_map for instance) in memory mapped file, so I need something like offset kind of pointer to deal with (collection can be mapped to any random address later so I need offset from the beginning of mapped region)). The goal is to create some big dictionary the way I don't have to initialize it every time to use it effective way (just attaching/mapping only to any available mem location on app startup). When I try to implement it in Visual Studio 2015 update 3 I receive compilation errors showing collections (vector for instance) use raw pointers internally instead of my class to represent offset pointers. I know boost/interprocess has own specialized/custom collections to persist data in shared memory (or memory mapped file), but I need data persistence way that can work with any STL container.
The question is like in title:
Does anybody know any STL implementation supporting custom smart pointer on custom allocators?
Maybe somebody did something like this already with success. I'm not sure definition of offset smart pointer is sufficient in such case only.
Aucun commentaire:
Enregistrer un commentaire