Boost C++ Libraries: Ticket #9418: key of fusion map could not be abstract type https://svn.boost.org/trac10/ticket/9418 <p> The following code fails to be compiled with Boost 1.55.0 using gcc 4.8.1. But work with Boost 1.53.0 using gcc 4.8.1. </p> <pre class="wiki">#include &lt;boost/fusion/include/map.hpp&gt; #include &lt;boost/fusion/include/pair.hpp&gt; namespace bf = boost::fusion; struct tagging { virtual void foo() = 0; }; int main() { bf::map&lt;bf::pair&lt;tagging, int&gt;&gt; booom; return 0; } </pre><p> gcc complains with the following </p> <pre class="wiki">In file included from /usr/local/include/boost/fusion/container/map/map_fwd.hpp:24:0, from /usr/local/include/boost/fusion/container/map/map.hpp:10, from /usr/local/include/boost/fusion/container/map.hpp:10, from /usr/local/include/boost/fusion/include/map.hpp:10, from main.cpp:1: /usr/local/include/boost/fusion/container/map/detail/map_impl.hpp: In instantiation of ‘struct boost::fusion::detail::map_impl&lt;0, boost::fusion::pair&lt;tagging, int&gt; &gt;’: /usr/local/include/boost/fusion/container/map/map.hpp:45:12: required from ‘struct boost::fusion::map&lt;boost::fusion::pair&lt;tagging, int&gt; &gt;’ main.cpp:13:37: required from here /usr/local/include/boost/fusion/container/map/detail/map_impl.hpp:116:18: error: cannot allocate an object of abstract type ‘tagging’ key_type get_key(mpl::int_&lt;index&gt;); ^ main.cpp:6:8: note: because the following virtual functions are pure within ‘tagging’: struct tagging ^ main.cpp:8:18: note: virtual void tagging::foo() virtual void foo() = 0; ^ In file included from /usr/local/include/boost/fusion/container/map/map_fwd.hpp:24:0, from /usr/local/include/boost/fusion/container/map/map.hpp:10, from /usr/local/include/boost/fusion/container/map.hpp:10, from /usr/local/include/boost/fusion/include/map.hpp:10, from main.cpp:1: /usr/local/include/boost/fusion/container/map/detail/map_impl.hpp:117:18: error: cannot allocate an object of abstract type ‘tagging’ key_type get_key(mpl::int_&lt;index&gt;) const; ^ main.cpp:6:8: note: since type ‘tagging’ has pure virtual functions struct tagging ^ </pre><p> I guess the failure is caused by the return value of 'get_key' in 'map_impl'. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9418 Trac 1.4.3 record.nctu.cis91@… Thu, 21 Nov 2013 16:59:34 GMT owner, component changed https://svn.boost.org/trac10/ticket/9418#comment:1 https://svn.boost.org/trac10/ticket/9418#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Douglas Gregor</span> to <span class="trac-author">Joel de Guzman</span> </li> <li><strong>component</strong> <span class="trac-field-old">function</span> → <span class="trac-field-new">fusion</span> </li> </ul> Ticket Joel de Guzman Wed, 18 Mar 2015 02:20:54 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9418#comment:2 https://svn.boost.org/trac10/ticket/9418#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> </ul> Ticket