I have a following boost::interprocess::map
:
using boost::interprocess;
std::shared_ptr< map<uint32, managed_shared_memory*> > myMap;
I have a method() which inserts into this map:
void InsertInMap(uint32 i)
{
myMap->insert( std::make_pair (i, // runtime error here
new managed_shared_memory(create_only, "Test", 256)) );
}
And in main()
, I call it like this:
int main()
{
InsertInMap(1);
}
This compiles fine.
But when I run my program, I get the following run-time error at the marked line (while insertion):
memory access violation occurred at address ......, while attempting to read inaccessible data
Am I missing something?