Opened 8 years ago

Last modified 8 years ago

#10322 new Bugs

documentation for erase method of multisets is wrong

Reported by: Matei David <matei@…> Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: intrusive
Version: Boost 1.56.0 Severity: Problem
Keywords: erase multiset documentation Cc:

Description

This is a documentation bug.

The page here states that erase(const_reference value) "erases the element pointed to by pos". First of all, this is a typo because pos is not an argument. One would assume that the element to be erased is the one referenced by value.

It turns out that this is wrong: this overload erases not just one element (the given one), but in fact, all elements of the multiset with key equivalent to the given one (according to the container's internal comparator method). This is immediately apparent by looking at the definition of erase(const_reference value) inside bstree.hpp.

Most likely this affects the documentation for the other multiset variants as well (avl, etc).

Attachments (1)

bug-erase.cpp (1.1 KB ) - added by Matei David <matei@…> 8 years ago.
demonstrates the bug (compile with std=c++11)

Download all attachments as: .zip

Change History (3)

by Matei David <matei@…>, 8 years ago

Attachment: bug-erase.cpp added

demonstrates the bug (compile with std=c++11)

comment:1 by Ion Gaztañaga, 8 years ago

It seems that we have a problem with Doxygen or BoostBook as I can see any error in the comment and the autodoc.xml has the wrong comment. I still don't know how to fix this without duplicating comments, something that I'd like to avoid. Thanks for the report.

comment:2 by Steven Watanabe, 8 years ago

BoostBook + Doxygen can't handle multiple overloads very well. The best way that I've found is to put all the documentation on the first overload and then mark the rest with \overload.

Note: See TracTickets for help on using tickets.