Boost C++ Libraries: Ticket #9565: [boost] [range] size.hpp template parameter did not match the requirement https://svn.boost.org/trac10/ticket/9565 <p> <code>boost::size</code> requires random access range, but the template parameter is named single pass range. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9565 Trac 1.4.3 Lin, Yi-Li <record.nctu.cis91@…> Mon, 13 Jan 2014 03:15:22 GMT attachment set https://svn.boost.org/trac10/ticket/9565 https://svn.boost.org/trac10/ticket/9565 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_range_size.patch</span> </li> </ul> <p> change template parameter name to '<a class="missing wiki">RandomAccessRange</a>' </p> Ticket Neil Groves Fri, 21 Feb 2014 17:24:49 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9565#comment:1 https://svn.boost.org/trac10/ticket/9565#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> That's not quite correct. The implementation for iterators requires <a class="missing wiki">RandomAccess</a> 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 <a class="missing wiki">SinglePassRange</a> concept and provide range_size to be found by ADL. </p> Ticket