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: | 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)
Change History (2)
by , 9 years ago
Attachment: | boost_range_size.patch added |
---|
comment:1 by , 9 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
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.
change template parameter name to 'RandomAccessRange'