Boost C++ Libraries: Ticket #12955: ambiguous member when calling upper_bound_rank https://svn.boost.org/trac10/ticket/12955 <p> When using a boost::multi_index::multi_index_container with ranked indices, trying to call upper_bound_rank on any but the <strong>last</strong> ranked index listed in the indexed_by template parameter of the multi_index_container gives the following compiler error (in gcc 4.9, and MSVC 14 gives a similar error): </p> <pre class="wiki">/usr/local/boost_1_63_0/boost/multi_index/detail/rnk_index_ops.hpp:216:22: error: request for member ‘size’ is ambiguous std::size_t s=top-&gt;size; ^ In file included from /home/aqsystem/repos/md/cpp/test_proj/main.cpp:2:0: /usr/local/boost_1_63_0/boost/multi_index/ranked_index.hpp:32:15: note: candidates are: std::size_t boost::multi_index::detail::ranked_node&lt;boost::multi_index::detail::ordered_index_node_compressed_base&lt;boost::multi_index::detail::rank_policy, std::allocator&lt;char&gt; &gt; &gt;::size std::size_t size; ^ /usr/local/boost_1_63_0/boost/multi_index/ranked_index.hpp:32:15: note: std::size_t boost::multi_index::detail::ranked_node&lt;boost::multi_index::detail::ordered_index_node_compressed_base&lt;boost::multi_index::detail::rank_policy, std::allocator&lt;char&gt; &gt; &gt;::size make[3]: *** [test_proj/CMakeFiles/test_proj.dir/main.cpp.o] Error 1 </pre><p> Attached is code that exhibits this error- you can see that trying to call upper_bound_rank on the first or second index of the multi_index_container produces the compiler error given above, and that calling it on the third (and final ranked) index does not. Changing the fourth index to be ranked_unique or ranked_non_unique will cause the third index to also product the above compiler error. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12955 Trac 1.4.3 Rob Rose <rrose@…> Fri, 07 Apr 2017 18:24:04 GMT attachment set https://svn.boost.org/trac10/ticket/12955 https://svn.boost.org/trac10/ticket/12955 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">main.cpp</span> </li> </ul> Ticket Joaquín M López Muñoz Mon, 10 Apr 2017 10:39:09 GMT status, version changed; resolution set https://svn.boost.org/trac10/ticket/12955#comment:1 https://svn.boost.org/trac10/ticket/12955#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.63.0</span> → <span class="trac-field-new">Boost 1.64.0</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Hi Rob, thanks for reporting this bug, fixed at: </p> <p> <a class="ext-link" href="https://github.com/boostorg/multi_index/commit/3e1095d6098a2ef28c796be4a99371a82b4ebd3e"><span class="icon">​</span>https://github.com/boostorg/multi_index/commit/3e1095d6098a2ef28c796be4a99371a82b4ebd3e</a> </p> <p> Will try to push the commit to Boost 1.64, otherwise it'll go with Boost 1.65. </p> Ticket Rob Rose <rrose@…> Mon, 10 Apr 2017 12:45:43 GMT <link>https://svn.boost.org/trac10/ticket/12955#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12955#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12955#comment:1" title="Comment 1">joaquin</a>: thanks joaquin, that was fast! </p> <blockquote class="citation"> <p> Hi Rob, thanks for reporting this bug, fixed at: </p> <p> <a class="ext-link" href="https://github.com/boostorg/multi_index/commit/3e1095d6098a2ef28c796be4a99371a82b4ebd3e"><span class="icon">​</span>https://github.com/boostorg/multi_index/commit/3e1095d6098a2ef28c796be4a99371a82b4ebd3e</a> </p> <p> Will try to push the commit to Boost 1.64, otherwise it'll go with Boost 1.65. </p> </blockquote> </description> <category>Ticket</category> </item> </channel> </rss>