
On 10/29/07, Thorsten Ottosen <thorsten.ottosen@dezide.com> 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.
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.
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? 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. Daniel