Boost C++ Libraries: Ticket #12789: Instantiating bimap with all three "additional" template parameter fails to compile. https://svn.boost.org/trac10/ticket/12789 <p> The following test program fails to compile. </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;boost/bimap.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;memory&gt;</span><span class="cp"></span> <span class="kt">void</span> <span class="nf">test</span><span class="p">()</span> <span class="p">{</span> <span class="n">boost</span><span class="o">::</span><span class="n">bimap</span><span class="o">&lt;</span><span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="p">,</span> <span class="n">boost</span><span class="o">::</span><span class="n">bimaps</span><span class="o">::</span><span class="n">left_based</span><span class="p">,</span> <span class="n">boost</span><span class="o">::</span><span class="n">bimaps</span><span class="o">::</span><span class="n">with_info</span><span class="o">&lt;</span><span class="kt">int</span><span class="o">&gt;</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">allocator</span><span class="o">&lt;</span><span class="kt">void</span><span class="o">&gt;&gt;</span> <span class="n">map</span><span class="p">;</span> <span class="p">}</span> </pre></div></div><p> The compile error from g++ 4.9.2 starts with: </p> <pre class="wiki">jhaigh@growler:~/tmp/tmp$ g++ -std=c++11 bimap_error.cpp In file included from /usr/include/boost/bimap/bimap.hpp:61:0, from /usr/include/boost/bimap.hpp:13, from bimap_error.cpp:1: /usr/include/boost/bimap/detail/bimap_core.hpp: In instantiation of ‘class boost::bimaps::detail::bimap_core&lt;int, int, boost::bimaps::left_based, boost::bimaps::with_info&lt;int&gt;, std::allocator&lt;void&gt; &gt;’: /usr/include/boost/bimap/bimap.hpp:133:7: required from ‘class boost::bimaps::bimap&lt;int, int, boost::bimaps::left_based, boost::bimaps::with_info&lt;int&gt;, std::allocator&lt;void&gt; &gt;’ bimap_error.cpp:5:106: required from here /usr/include/boost/bimap/detail/bimap_core.hpp:410:7: error: no class template named ‘rebind’ in ‘boost::bimaps::detail::manage_additional_parameters&lt;boost::bimaps::left_based, boost::bimaps::with_info&lt;int&gt;, std::allocator&lt;void&gt; &gt;::case_SHA::allocator {aka struct boost::bimaps::with_info&lt;int&gt;}’ ... </pre><p> Boost thinks my with_info parameter is an allocator! The full compiler output will be attached, but I think this is enough to see the problem. </p> <p> It looks like the cause is the case_SHA struct in boost/bimap/detail/manage_additional_parameters that deals with the case when all three additional template parameters are given to bimap: </p> <div class="wiki-code"><div class="code"><pre><span class="k">template</span><span class="o">&lt;</span> <span class="k">class</span> <span class="nc">AP1</span><span class="p">,</span> <span class="k">class</span> <span class="nc">AP2</span><span class="p">,</span> <span class="k">class</span> <span class="nc">AP3</span> <span class="o">&gt;</span> <span class="k">struct</span> <span class="n">manage_additional_parameters</span> <span class="p">{</span> <span class="p">...</span> <span class="k">struct</span> <span class="n">case_SHA</span> <span class="p">{</span> <span class="k">typedef</span> <span class="n">AP1</span> <span class="n">set_type_of_relation</span><span class="p">;</span> <span class="k">typedef</span> <span class="n">AP2</span> <span class="n">allocator</span><span class="p">;</span> <span class="k">typedef</span> <span class="n">BOOST_DEDUCED_TYPENAME</span> <span class="n">AP2</span><span class="o">::</span><span class="n">value_type</span> <span class="n">additional_info</span><span class="p">;</span> <span class="p">};</span> </pre></div></div><p> AP2 is used for both the allocator type and the additional_info type. I think allocator should be typedefed to AP3, not AP2. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12789 Trac 1.4.3 Jonathan Haigh <jonathan.haigh@…> Wed, 25 Jan 2017 15:22:36 GMT attachment set https://svn.boost.org/trac10/ticket/12789 https://svn.boost.org/trac10/ticket/12789 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bimap_compile_error.txt</span> </li> </ul> Ticket