Boost C++ Libraries: Ticket #7423: std::map::erase returns iterator in C++11 mode instead of void, should be handled properly https://svn.boost.org/trac10/ticket/7423 <p> The issue is with the following code: boost/phoenix/stl/container.hpp, line 284 </p> <pre class="wiki"> namespace result_of { template &lt;typename C, typename Arg1, typename Arg2 = mpl::void_&gt; struct erase { // BOOST_MSVC #if branch here in map_erase_result non- // standard behavior. The return type should be void but // VC7.1 prefers to return iterator_of&lt;C&gt;. As a result, // VC7.1 complains of error C2562: // boost::phoenix::stl::erase::operator() 'void' function // returning a value. Oh well... :* typedef boost::mpl::eval_if_c&lt; boost::is_same&lt; typename remove_reference&lt;Arg1&gt;::type , typename iterator_of&lt;C&gt;::type &gt;::value #if defined(BOOST_MSVC)// &amp;&amp; (BOOST_MSVC &lt;= 1500) , iterator_of&lt;C&gt; #else , boost::mpl::identity&lt;void&gt; #endif , size_type_of&lt;C&gt; &gt; map_erase_result; typedef typename boost::mpl::eval_if_c&lt; has_mapped_type&lt;C&gt;::value , map_erase_result , iterator_of&lt;C&gt; &gt;::type type; }; } </pre><p> It seems that MSVC's behaviour becomes the standard one with C++11. </p> <p> Also the current check seems to be done incorrectly because Intel Compiler uses MSVC's stl library on Windows, so checking for _MSC_VER will be more appropriate, I think. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7423 Trac 1.4.3 Kohei Takahashi Sun, 14 May 2017 03:59:21 GMT owner changed https://svn.boost.org/trac10/ticket/7423#comment:1 https://svn.boost.org/trac10/ticket/7423#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Thomas Heller</span> to <span class="trac-author">Kohei Takahashi</span> </li> </ul> Ticket Kohei Takahashi Tue, 16 May 2017 15:37:34 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/7423#comment:2 https://svn.boost.org/trac10/ticket/7423#comment:2 <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">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.65.0</span> </li> </ul> <p> Fixed in <a class="ext-link" href="https://github.com/boostorg/phoenix/pull/52"><span class="icon">​</span>https://github.com/boostorg/phoenix/pull/52</a> </p> Ticket