Boost logo

Boost Users :

Subject: Re: [Boost-users] [Range] Single Pass Range functionality
From: Edward Diener (eldiener_at_[hidden])
Date: 2009-02-23 08:02:42


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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net