Modify

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#12955 closed Bugs (fixed)

ambiguous member when calling upper_bound_rank

Reported by: Rob Rose <rrose@…> Owned by: Joaquín M López Muñoz
Milestone: To Be Determined Component: multi_index
Version: Boost 1.64.0 Severity: Problem
Keywords: multi_index, upper_bound_rank, ambiguous Cc:

Description

When using a boost::multi_index::multi_index_container with ranked indices, trying to call upper_bound_rank on any but the last 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):

/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->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<boost::multi_index::detail::ordered_index_node_compressed_base<boost::multi_index::detail::rank_policy, std::allocator<char> > >::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<boost::multi_index::detail::ordered_index_node_compressed_base<boost::multi_index::detail::rank_policy, std::allocator<char> > >::size
make[3]: *** [test_proj/CMakeFiles/test_proj.dir/main.cpp.o] Error 1

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.

Attachments (1)

main.cpp (1.1 KB) - added by Rob Rose <rrose@…> 8 months ago.

Download all attachments as: .zip

Change History (3)

Changed 8 months ago by Rob Rose <rrose@…>

Attachment: main.cpp added

comment:1 Changed 8 months ago by Joaquín M López Muñoz

Resolution: fixed
Status: newclosed
Version: Boost 1.63.0Boost 1.64.0

Hi Rob, thanks for reporting this bug, fixed at:

https://github.com/boostorg/multi_index/commit/3e1095d6098a2ef28c796be4a99371a82b4ebd3e

Will try to push the commit to Boost 1.64, otherwise it'll go with Boost 1.65.

comment:2 in reply to:  1 Changed 8 months ago by Rob Rose <rrose@…>

Replying to joaquin: thanks joaquin, that was fast!

Hi Rob, thanks for reporting this bug, fixed at:

https://github.com/boostorg/multi_index/commit/3e1095d6098a2ef28c796be4a99371a82b4ebd3e

Will try to push the commit to Boost 1.64, otherwise it'll go with Boost 1.65.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Joaquín M López Muñoz.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.