Boost logo

Boost Users :

Subject: Re: [Boost-users] intrusive bug: equal_range implementation vs bounded_range precondition
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2014-12-12 18:03:56


El 12/12/2014 2:02, Matei David escribió:
> In the absence of a bug tracker, I'll post the potential bug here:
>
> I'm seeing some strange results out of `multiset::equal_range`. I
> didn't isolate a test case, but looking at the code something seems
> wrong:
>
> The `bstree_algorithms::equal_range(const KeyType &, KeyValueCompare)`
> method is currently implemented (in `bstree_algorithms.hpp`) as a call
> to `bstree_algorithms::bounded_range(header, key, key, comp, true,
> true)`. However, `bounded_range` states as prerequisite: If 'lower_key'
> == 'upper_key', ('left_closed' or 'right_closed') must be false.
>
> Either the `equal_range` implementation or the `bounded_range`
> precondition is wrong.

The precondition is wrong. It should read "('left_closed' AND
'right_closed') must be false.

Ion


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net