Opened 10 years ago
Closed 9 years ago
#6888 closed Bugs (fixed)
range::unique does not forward predicate
Reported by: | Owned by: | Neil Groves | |
---|---|---|---|
Milestone: | To Be Determined | Component: | range |
Version: | Boost 1.49.0 | Severity: | Problem |
Keywords: | range unique | Cc: |
Description
At boost\range\algorithm\unique.hpp:92
/// \overload template< class ForwardRange, class BinaryPredicate > inline BOOST_DEDUCED_TYPENAME range_return<ForwardRange, return_begin_found>::type unique( ForwardRange& rng, BinaryPredicate pred ) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> )); return ::boost::range::unique<return_begin_found>(rng); }
does not forward pred
Attachments (2)
Change History (7)
by , 10 years ago
Attachment: | unique_bug.cpp added |
---|
comment:1 by , 10 years ago
I also changed the signature of the function accepting a const range&, range/algorithm/unique.hpp:96
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange, return_begin_found>::type
That is in line with the other overloads, and I couldn't get the newer tests to work without that.
Additionally, in the unique.cpp tests, the predicate being used was incorrect - it was using std::less and std::greater for comparing equality. I changed them to be using std::equal_to
comment:2 by , 10 years ago
Component: | None → range |
---|---|
Owner: | set to |
follow-up: 4 comment:3 by , 9 years ago
The proposed changes have been applied to the trunk. Thanks for helping. Please accept my apologies for failing to cover the full overload set.
comment:4 by , 9 years ago
No apology necessary! I love the Boost Range library, and am happy to have helped in this small way.
comment:5 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Example of bug