
"David Abrahams" <dave@boost-consulting.com> wrote in message news:uhditw87f.fsf@boost-consulting.com... | "Thorsten Ottosen" <nesotto@cs.auc.dk> writes: | > range_adl_begin() | > range_adl_end() | > range_adl_size() | > | > Any comments before I commit? | | [I hope we've dropped "adl_" from the name by now ;-) ] yes. | A scheme like this one has at least one advantage that we should be | sure to take advantage of: it allows us to reduce the number of | overloads required by conforming range classes. | // Note: this partial specialization is important! | template <class Sequence> | struct begin_iterator<Sequence const> | { | typedef typename sequence::traits< | Sequence | >::begin_const_iterator type; | }; | // Note: no overload for Range const&. This is never | // called directly, so it always receives an lvalue. | template <class Range> | typename begin_iterator<Sequence>::type | sequence_begin(Range& s) | { | return ... // whatever | } This is a good observation. You can already do that as template< class R > inline typename range_result_iterator<R>::type range_begin( R& r ); ^^^^^^^^^^^^^^^^^^^^^^^^ I don't use partial specialization, but rather eval_if< is_const<R>, const_iterator, iterator>::type, but I guess that not thaht important. I will update the docs to reflect this easier way to adopt a new type. And I will consider removing half of the actual function implementations. -Thorsten