Boost C++ Libraries: Ticket #3298: Iterating over a map fails to compile with MSVC 9 (works with CYGWIN GCC 4.3.2) https://svn.boost.org/trac10/ticket/3298 <p> I have written a template metafunction that takes two maps and joins them into a single map. However, if keys are erased from both maps before joining them, the iterators of the joined map fail to compile with MSVC 9. The code compiles with CYGWIN GCC 4.3.2. If a key is erased from only one of the original maps, the code compiles with both compilers. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3298 Trac 1.4.3 Marshall Galbraith <Marshall.Galbraith@…> Wed, 29 Jul 2009 05:02:17 GMT attachment set https://svn.boost.org/trac10/ticket/3298 https://svn.boost.org/trac10/ticket/3298 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">join_map_test.cpp</span> </li> </ul> <p> Example code that compiles with CYGWIN GCC 4.3.2 but now MSVC 9 </p> Ticket Marshall Galbraith Wed, 29 Jul 2009 14:09:09 GMT <link>https://svn.boost.org/trac10/ticket/3298#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3298#comment:1</guid> <description> <p> First I want to acknowledge that I am an MPL novice, and am still learning the ropes of this extremely useful library. I have attached an updated example of the problem. This implementation takes better advantage of the tools provided in the mpl library. </p> <p> I have two template meta functions defined in this example which joins two maps, MapL and MapR. The first function, join_maps_1, generates a new copy of the joint maps using copy and joint_view. If I understand things correctly, this requires size&lt;MapL&gt; + size&lt;MapR&gt; instantiations. This version seems to work without problems. </p> <p> The second function, join_maps_2, inserts MapR into MapL using copy&lt;&gt;. It should require size&lt;MapL&gt; instantiations. However, if the resulting map is passed to for_each&lt;&gt;, the code fails to compile with MSVC 9 if a key has been erase from MapL. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Galbraith</dc:creator> <pubDate>Wed, 29 Jul 2009 14:10:15 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/3298 https://svn.boost.org/trac10/ticket/3298 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">join_map_test_2.cpp</span> </li> </ul> <p> Updated example using MPL functions to join maps </p> Ticket Steven Watanabe Sat, 22 Aug 2009 15:47:11 GMT <link>https://svn.boost.org/trac10/ticket/3298#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3298#comment:2</guid> <description> <p> This sounds like a result of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2042" title="#2042: Bugs: map insert does not work after an erase in the non-typeof implementation (closed: fixed)">#2042</a>. Does the patch there fix your problem? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Galbraith</dc:creator> <pubDate>Sat, 22 Aug 2009 19:10:25 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3298#comment:3 https://svn.boost.org/trac10/ticket/3298#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">duplicate</span> </li> </ul> <p> This patch did indeed resolve the problem. I apologize for not discovering it on my own. </p> <p> Is there a reason why the patch has not made it into the main repository? </p> Ticket Steven Watanabe Sat, 22 Aug 2009 19:21:24 GMT <link>https://svn.boost.org/trac10/ticket/3298#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3298#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/3298#comment:3" title="Comment 3">Marshall Galbraith</a>: </p> <blockquote class="citation"> <p> Is there a reason why the patch has not made it into the main repository? </p> </blockquote> <p> I'll try to get it in soon, but it's probably too late for 1.40. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Aleksey Gurtovoy</dc:creator> <pubDate>Mon, 24 Aug 2009 04:22:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3298#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3298#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/3298#comment:4" title="Comment 4">steven_watanabe</a>: </p> <blockquote class="citation"> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/3298#comment:3" title="Comment 3">Marshall Galbraith</a>: </p> <blockquote class="citation"> <p> Is there a reason why the patch has not made it into the main repository? </p> </blockquote> <p> I'll try to get it in soon, but it's probably too late for 1.40. </p> </blockquote> <p> I've just merged Steven's fix to the release branch, so it should make it to 1.40 after all. </p> </description> <category>Ticket</category> </item> </channel> </rss>