
On 13 September 2010 14:21, Hossein Haeri
I have an instance of boost::unordered_map<> somewhere in my codebase (GCC 4.5.1, MinGW, WinXP) with the following funny piece of test code:
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?
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.
Am I missing anything? Or, is this a bug in the implementation of boost::unordered_map<>?
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? Daniel