Boost C++ Libraries: Ticket #5774: Boost Signals 1.48 gcc 4.6.1 error https://svn.boost.org/trac10/ticket/5774 <p> Dear Boost Signals mantainer </p> <p> The component no longer compiles (See error below) Ubuntu oneiric Boost trunk gcc 4.6.1 - ./b2 address-model=64 cxxflags=-std=gnu++0x </p> <p> Apparently std::map expects either a map::const_iterator or a const ref to map::key, </p> <p> Thank you, </p> <p> R. </p> <pre class="wiki">gcc.compile.c++ bin.v2/libs/signals/build/gcc-4.6.1/release/address-model-64/threading-multi/named_slot_map.o libs/signals/src/named_slot_map.cpp: In member function ‘void boost::signals::detail::named_slot_map::disconnect(const boost::signals::detail::stored_group&amp;)’: libs/signals/src/named_slot_map.cpp:105:23: error: call of overloaded ‘erase(boost::signals::detail::named_slot_map::group_iterator&amp;)’ is ambiguous libs/signals/src/named_slot_map.cpp:105:23: note: candidates are: /usr/include/c++/4.6/bits/stl_map.h:613:7: note: std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::iterator std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::erase(std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::const_iterator) [with _Key = boost::signals::detail::stored_group, _Tp = std::list&lt;boost::signals::detail::connection_slot_pair&gt;, _Compare = boost::function2&lt;bool, boost::signals::detail::stored_group, boost::signals::detail::stored_group&gt;, _Alloc = std::allocator&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;, std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::iterator = std::_Rb_tree_iterator&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;, std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::const_iterator = std::_Rb_tree_const_iterator&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;] /usr/include/c++/4.6/bits/stl_map.h:643:7: note: std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::size_type std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::erase(const key_type&amp;) [with _Key = boost::signals::detail::stored_group, _Tp = std::list&lt;boost::signals::detail::connection_slot_pair&gt;, _Compare = boost::function2&lt;bool, boost::signals::detail::stored_group, boost::signals::detail::stored_group&gt;, _Alloc = std::allocator&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;, std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::size_type = long unsigned int, std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::key_type = boost::signals::detail::stored_group] libs/signals/src/named_slot_map.cpp: In member function ‘void boost::signals::detail::named_slot_map::remove_disconnected_slots()’: libs/signals/src/named_slot_map.cpp:128:35: error: call of overloaded ‘erase(std::_Rb_tree_iterator&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;::_Self)’ is ambiguous libs/signals/src/named_slot_map.cpp:128:35: note: candidates are: /usr/include/c++/4.6/bits/stl_map.h:613:7: note: std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::iterator std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::erase(std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::const_iterator) [with _Key = boost::signals::detail::stored_group, _Tp = std::list&lt;boost::signals::detail::connection_slot_pair&gt;, _Compare = boost::function2&lt;bool, boost::signals::detail::stored_group, boost::signals::detail::stored_group&gt;, _Alloc = std::allocator&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;, std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::iterator = std::_Rb_tree_iterator&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;, std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::const_iterator = std::_Rb_tree_const_iterator&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;] /usr/include/c++/4.6/bits/stl_map.h:643:7: note: std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::size_type std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::erase(const key_type&amp;) [with _Key = boost::signals::detail::stored_group, _Tp = std::list&lt;boost::signals::detail::connection_slot_pair&gt;, _Compare = boost::function2&lt;bool, boost::signals::detail::stored_group, boost::signals::detail::stored_group&gt;, _Alloc = std::allocator&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;, std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::size_type = long unsigned int, std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::key_type = boost::signals::detail::stored_group] "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -m64 -std=gnu++0x -DBOOST_ALL_NO_LIB=1 -DBOOST_SIGNALS_DYN_LINK=1 -DBOOST_SIGNALS_NO_LIB=1 -DNDEBUG -I"." -c -o "bin.v2/libs/signals/build/gcc-4.6.1/release/address-model-64/threading-multi/named_slot_map.o" "libs/signals/src/named_slot_map.cpp" ...failed gcc.compile.c++ bin.v2/libs/signals/build/gcc-4.6.1/release/address-model-64/threading-multi/named_slot_map.o... gcc.compile.c++ bin.v2/libs/signals/build/gcc-4.6.1/release/address-model-64/threading-multi/signal_base.o libs/signals/src/signal_base.cpp: In static member function ‘static void boost::signals::detail::signal_base_impl::slot_disconnected(void*, void*)’: libs/signals/src/signal_base.cpp:136:37: warning: ‘auto_ptr’ is deprecated (declared at /usr/include/c++/4.6/backward/auto_ptr.h:87) [-Wdeprecated-declarations] gcc.compile.c++ bin.v2/libs/signals/build/gcc-4.6.1/release/address-model-64/threading-multi/slot.o ...skipped &lt;pbin.v2/libs/signals/build/gcc-4.6.1/release/address-model-64/threading-multi&gt;libboost_signals.so.1.48.0 for lack of &lt;pbin.v2/libs/signals/build/gcc-4.6.1/release/address-model-64/threading-multi&gt;named_slot_map.o... ...skipped &lt;p/adnet/boost-1.48.0/lib&gt;libboost_signals.so.1.48.0 for lack of &lt;pbin.v2/libs/signals/build/gcc-4.6.1/release/address-model-64/threading-multi&gt;libboost_signals.so.1.48.0... ...skipped &lt;p/adnet/boost-1.48.0/lib&gt;libboost_signals.so for lack of &lt;p/adnet/boost-1.48.0/lib&gt;libboost_signals.so.1.48.0... </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5774 Trac 1.4.3 leo goodstadt (boost <at> llew.org.uk) Wed, 07 Sep 2011 17:20:08 GMT <link>https://svn.boost.org/trac10/ticket/5774#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5774#comment:1</guid> <description> <p> Works with a cast: </p> <div class="wiki-code"><div class="code"><pre> <span class="n">groups</span><span class="p">.</span><span class="n">erase</span><span class="p">(</span><span class="k">static_cast</span><span class="o">&lt;</span><span class="n">const_group_iterator</span><span class="o">&gt;</span><span class="p">(</span><span class="n">group</span><span class="p">));</span> </pre></div></div><p> and </p> <div class="wiki-code"><div class="code"><pre> <span class="k">if</span> <span class="p">(</span><span class="n">empty</span><span class="p">(</span><span class="n">g</span><span class="p">))</span> <span class="n">groups</span><span class="p">.</span><span class="n">erase</span><span class="p">(</span><span class="k">static_cast</span><span class="o">&lt;</span><span class="n">const_group_iterator</span><span class="o">&gt;</span><span class="p">(</span><span class="n">g</span><span class="o">++</span><span class="p">));</span> </pre></div></div> </description> <category>Ticket</category> </item> <item> <author>Ben Pope <benpope81@…></author> <pubDate>Thu, 17 Nov 2011 09:41:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5774#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5774#comment:2</guid> <description> <p> Ping. </p> <p> Can this be fixed for 1.49? It's also mentioned in ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4999" title="#4999: Bugs: boost-log from SVN doesn't compile on gcc 4.6 (closed: fixed)">#4999</a>. </p> <p> This failure is with both gcc-4.6.1 and clang-3.0-rc3 when -std=c++0x. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 24 Nov 2011 08:45:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5774#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5774#comment:3</guid> <description> <p> Apparently this is an issue with the new C++11 standard, which changed the argument type of map::erase from iterator to const_iterator. Thus the fix has to be C++11 specific. </p> <p> Claas </p> </description> <category>Ticket</category> </item> <item> <author>kyle.tarplee@…</author> <pubDate>Wed, 18 Jan 2012 14:04:28 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/5774#comment:4 https://svn.boost.org/trac10/ticket/5774#comment:4 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.48.0</span> → <span class="trac-field-new">Boost 1.49.0</span> </li> </ul> <p> This also breaks on clang++ with libc++. </p> <p> The second fix mentioned in <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4999" title="#4999: Bugs: boost-log from SVN doesn't compile on gcc 4.6 (closed: fixed)">#4999</a> seems to work for me. </p> Ticket viboes Wed, 12 Jun 2013 21:55:13 GMT <link>https://svn.boost.org/trac10/ticket/5774#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5774#comment:5</guid> <description> <p> Has this been fixed? </p> </description> <category>Ticket</category> </item> <item> <author>Ramon Casellas <ramon.casellas@…></author> <pubDate>Thu, 13 Jun 2013 06:26:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5774#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5774#comment:6</guid> <description> <p> Afaict yes, although my toolchain is now gcc 4.8.1/4.9 and 1.54. Feel free to close the ticket . Thanks, R. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Tue, 18 Jun 2013 16:51:51 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5774#comment:7 https://svn.boost.org/trac10/ticket/5774#comment:7 <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> </ul> Ticket