Boost logo

Boost :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2006-05-23 12:21:58


Shunsuke Sogame wrote:
> Daniel Walker wrote:
>
>>On 5/23/06, Shunsuke Sogame <mb2act_at_[hidden]> wrote:
>>
>>>BTW, I found a bug:
>>> <boost/range/concepts.hpp> seems to
>>> apply 'boost::size' to Forward Range.
>>
>>If I recall correctly applying boost::size() was intentional. size(r)
>>is a valid expression for the ForwardRange concept,

Well, that has changed.

> and I believe
>>Thorsten didn't want ADL to kick in, so in the concept check
>>implementation boost:: is used to qualify all the functions.
>>boost::size() eventually dispatches either a size() member of the
>>range object or std::distance().
>
>
> Updated cvs shows 'boost::size' uses 'operator-' ?
> I somewhat wonder why 'boost::size' and
> 'boost::range_size'

you mean just return range_difference<R>::type from size()?

That could be an idea. The only thing I hate is
that

vector<int>::size_type s = boost::size( cont );

will know generate a warning.

I wish we could synthesize range_size<> from range_difference<>.

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk