From 8f41e88f85adcb4189dcbb07e4bd8ef8d7894593 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Thu, 25 Jan 2001 04:57:16 +0000 Subject: [PATCH] fixed bug in assignment operator under VC++, which was the cause of the access violation error in graph/test/graph.cpp. The root of this bug is in compressed pair, which VC++ has a hard time generating a correct operator= for. [SVN r8767] --- include/boost/pending/iterator_adaptors.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/boost/pending/iterator_adaptors.hpp b/include/boost/pending/iterator_adaptors.hpp index 8ceb505..f4a5b12 100644 --- a/include/boost/pending/iterator_adaptors.hpp +++ b/include/boost/pending/iterator_adaptors.hpp @@ -333,6 +333,14 @@ public: policies().initialize(iter()); } +#ifdef BOOST_MSVC + // This is required to prevent a bug in how VC++ generates + // the assignment operator for compressed_pair. + iterator_adaptor& operator= (const iterator_adaptor& x) { + m_iter_p = x.m_iter_p; + return *this; + } +#endif reference operator*() const { return policies().dereference(type(), iter()); }