
Daniel,
container_[id].insert(v);
What's the full type of the unordered_map? As you seem to be inserting into the mapped value, is that right?
Yes. And, the full type is something like:
unordered_map
cout << "container insertion succesful" << endl; cout << "The container now contains " << container_.size() << " ids in it." << endl; cout << "distance from begin to end = " << distance(container_.begin(), container_.end()) << endl;
Can you try changing that to 'std::distance(container_.begin(), container_.end())' to make sure that the correct function is called.
A few lines earlier I had written using std::distance;
It might be. Would it be possible to create a compilable demonstration of the issue? Or some more information on how you set up the container and what methods you have called?
In fact, I realised that that was a bug in my own code. I had a shared_ptr to container_ that was trying to destruct it earlier than it should have. Having the bug fixed though, I still think that this was a strange behaviour for the container should have failed to produce anything for any of the cout's above. I'll try to see if -- without the bug there -- I can still produce a minimalist demonstration to pass over. I'll let you know... Cheers, --Hossein