Subject: [Boost-bugs] [Boost C++ Libraries] #11701: Regression in boost::intrusive::set::equal_range
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-10-01 06:55:02
#11701: Regression in boost::intrusive::set::equal_range
------------------------------+------------------------
Reporter: nyh@⦠| Owner: igaztanaga
Type: Bugs | Status: new
Milestone: To Be Determined | Component: intrusive
Version: Boost 1.57.0 | Severity: Regression
Keywords: |
------------------------------+------------------------
This bug was discovered by Daniel Peebles in https://github.com/cloudius-
systems/osv/issues/635
'''equal_range()''' is supposed to be a slightly more efficient way to
obtain both lower_bound() and upper_bound(). But as this issue
demonstrates, '''boost::intrusive::set''' :: equal_range() was correct in
Boost 1.55 (tested on a Fedora 21 installation) but is broken in Boost
1.57 (tested on a Fedora 22 installation).
The attached simplified reproducer program builds a boost::intrusive::set
of a "myrange" type - simple disjoint integer ranges, and then uses a
separate user-defined comparator "comp" in finding the lower and upper
bound, as well as equal_range.
The output in Boost 1.55 is the expected output:
{{{
equal_range: (5, 8) - (10, 13)
lower_bound: (5, 8)
upper_bound: (10, 13)
}}}
Indeed, "(5,8)" is the first item to match, and "(10,13)" is the one past
the last.
But, the output in Boost 1.57 is different:
{{{
equal_range: (5, 8) - (8, 10)
lower_bound: (5, 8)
upper_bound: (10, 13)
}}}
Note how equal_range() is now incorrect ("(8,10)" still does not compare
less according to "comp"), and moreover, different than what upper_bound()
returns (which is the correct response).
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11701> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC