Boost logo

Boost :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2007-10-29 12:30:00


Daniel Walker skrev:
> On 10/29/07, Thorsten Ottosen <thorsten.ottosen_at_[hidden]> wrote:
>> shunsuke skrev:
>>> Thorsten Ottosen wrote:
>>>> You would rather see range_mutable_iterator and range_const_iterator there?
>>> Yes.
>>>
>>> I've found an interesting quote in doc/boost_range.html:
>>>
>>> The special metafunctions range_result_iterator and range_reverse_result_iterator
>>> are not part of any Range concept,
>>>
>>> You knew it.
>> Well, those docs are so old now, I'm not sure they should be take too
>> seriously.
>>
>> The formulation I'm leaning towards in the new docs are the following:
>>
>> Single Pass Range:
>>
>> types:
>>
>> range_iterator<T>::type
>> range_iterator<const T>::type
>
> What if you have a non-const range of const_iterators? It seems like
> you still need range_const_iterator.

Why?

>> range_size<T>::type
>>
>> expresions:
>>
>> boost::begin(r)
>> boost::end(r)
>>
>> ...
>>
>> Random Access Range:
>>
>> expressions:
>> boost::size(r);
>
> This is good. It looks the same as the currently documented concepts
> except the syntax of return types of functions needs to be specified;
> i.e. the return type of begin(r) may be assigned to
> range_iterator<T>::type, etc.

right.

>> Now, the ways you provide a concept map may involve
>> types such as range_mutable_iterator, const_iterator, and functions
>> range_begin/range_end.
>
> What do you mean by "concept map?" Are you referring to C++0x
> concept_map?

I'm referring to the same idea. Until now we didn't really have a good
terminology for what it meant to "extend the library".

> Or do you mean these types and functions will help users
> implement a type that models a range concept in C++98 terms? I think
> the later, but I want to make sure.

Right.

-Thorsten


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