Opened 11 years ago

Closed 11 years ago

#5993 closed Bugs (fixed)

range::accumulate is missing a const in a concept check

Reported by: Julien Nitard <julien.nitard@…> Owned by: Neil Groves
Milestone: Boost 1.50.0 Component: range
Version: Boost 1.47.0 Severity: Problem
Keywords: accumulate range const Cc:

Description

The first overload of boost::accumulate, (const SinglePassRange&, Value) is not checking for the proper concept. It checks for the non-const version, which causes problem when passing a range that is not mutable.

The following line must changed from: BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));

To: BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));

Like it is in the 2nd overload.

Attachments (2)

range_accumulate_bug.cpp (591 bytes ) - added by Julien Nitard <julien.nitard@…> 11 years ago.
sample to reproduce the problem
numeric.hpp.patch (560 bytes ) - added by julien.nitard@… 11 years ago.
Path for the proper file.

Download all attachments as: .zip

Change History (3)

by Julien Nitard <julien.nitard@…>, 11 years ago

Attachment: range_accumulate_bug.cpp added

sample to reproduce the problem

by julien.nitard@…, 11 years ago

Attachment: numeric.hpp.patch added

Path for the proper file.

comment:1 by Neil Groves, 11 years ago

Milestone: To Be DeterminedBoost 1.50.0
Resolution: fixed
Status: newclosed

Resolved on trunk.

Note: See TracTickets for help on using tickets.