[Range] Single Pass Range functionality
In the Boost Range documentation describing the Range concepts for a single pass range it lists in the expression semantics post-condition for boost::begin(a): "boost::begin(a) is either dereferenceable or past-the-end. It is past-the-end if and only if boost::distance(a) == 0." However the documentation for single pass range does not list boost::distance as a valid expression nor in the reference section is boost::distance listed as a single pass range function. Is boost::distance a valid function when applied to a single pass range ?
Edward Diener skrev:
In the Boost Range documentation describing the Range concepts for a single pass range it lists in the expression semantics post-condition for boost::begin(a):
"boost::begin(a) is either dereferenceable or past-the-end. It is past-the-end if and only if boost::distance(a) == 0."
However the documentation for single pass range does not list boost::distance as a valid expression nor in the reference section is boost::distance listed as a single pass range function.
Is boost::distance a valid function when applied to a single pass range ?
Yes. boost::distance() is specified in terms of std::distance(). -Thorsten
Thorsten Ottosen wrote:
Edward Diener skrev:
In the Boost Range documentation describing the Range concepts for a single pass range it lists in the expression semantics post-condition for boost::begin(a):
"boost::begin(a) is either dereferenceable or past-the-end. It is past-the-end if and only if boost::distance(a) == 0."
However the documentation for single pass range does not list boost::distance as a valid expression nor in the reference section is boost::distance listed as a single pass range function.
Is boost::distance a valid function when applied to a single pass range ?
Yes. boost::distance() is specified in terms of std::distance().
OK. I think the Range documentation should be updated to reflect that. The implications of the Range documentation are currently that boost::distance is valid only for Forward Range on up.
participants (2)
-
Edward Diener
-
Thorsten Ottosen