
Ion GaztaƱaga wrote:
I can't seem to get the hang of strings though. I've looked around online and can't seem to find an example of how this should be set up, and I can't get it to accept an allocator. The only way I can seem to typedef one is something like:
typedef boost::interprocess::string BoostString - or - typedef boost::interprocess::basic_string<char> BoostString;
so defint it like this:
using namespace boost::interprocess; typedef basic_string
shm_string; As with vector, you will need to pass an allocator to the string cosntructor. See also string_test.cpp test in boost/libs/interprocess/test for an example of shared memory strings.
I'm still having a little trouble. The allocator they use in
string_test.cpp is one totally implemented there for that project; I'm not
going to have to do / copy that am I? I've tried:
typedef boost::interprocess::basic_string