From c8c4c1c289ae26cb5e90ceb661e8758cfa7953e4 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 17 Jan 2005 16:56:14 +0000 Subject: [PATCH] Fix for libstdc++ debug mode assertions: singular iterators can not be copied, so insertion into a container requires extra special care. [SVN r26718] --- include/boost/regex/pending/object_cache.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/regex/pending/object_cache.hpp b/include/boost/regex/pending/object_cache.hpp index 7364667d..1df43e92 100644 --- a/include/boost/regex/pending/object_cache.hpp +++ b/include/boost/regex/pending/object_cache.hpp @@ -116,7 +116,7 @@ boost::shared_ptr object_cache::do_get(const Key& k, size_t // Add it to the list, and index it: // s_data.cont.push_back(value_type(result, 0)); - s_data.index[k] = --(s_data.cont.end()); + s_data.index.insert(std::make_pair(k, --(s_data.cont.end()))); s_data.cont.back().second = &(s_data.index.find(k)->first); list_size_type s = s_data.cont.size(); BOOST_ASSERT(s_data.index[k]->first.get() == result.get());