Opened 9 years ago

Closed 9 years ago

#9565 closed Patches (invalid)

[boost] [range] size.hpp template parameter did not match the requirement

Reported by: Lin, Yi-Li <record.nctu.cis91@…> Owned by: Neil Groves
Milestone: To Be Determined Component: range
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

boost::size requires random access range, but the template parameter is named single pass range.

Attachments (1)

boost_range_size.patch (1.1 KB ) - added by Lin, Yi-Li <record.nctu.cis91@…> 9 years ago.
change template parameter name to 'RandomAccessRange'

Download all attachments as: .zip

Change History (2)

by Lin, Yi-Li <record.nctu.cis91@…>, 9 years ago

Attachment: boost_range_size.patch added

change template parameter name to 'RandomAccessRange'

comment:1 by Neil Groves, 9 years ago

Resolution: invalid
Status: newclosed

That's not quite correct. The implementation for iterators requires RandomAccess iterators, but this function is designed to allow extension for the common cases where we can provide customisation for container that have lesser iterators but still provide O(1) size such as std::list. Hence one of the goals of boost::size() is to support optimal O(1) size computation for ranges where this is known. std::list clear is bidirectional but it is quite possible to have containers or ranges that model the SinglePassRange concept and provide range_size to be found by ADL.

Note: See TracTickets for help on using tickets.