Thorsten Ottosen wrote:
"Jonathan Turkanis"
wrote:
Would it be possible to indroduce an extra level of indirection so that Range can be used with a type even if there are preexisting begin/end/.. functions that do the wrong thing? For instance,
<snip>
I was thinking of something like that too. May I ask why you want the functions inside a class
David Abrahams and Peter Dimov convinced me this was the only bullet-proof solution (no problems with ADL or order-dependencies.)
(partial specialization doesn't seem to be needed very frequently, does it)?
I would rather a protocol like this was made:
template< class T > typename range_iterator<T>::type begin( T& r ) { return adl_begin(r); }
This would probably be sufficient, on the assumption that adl_xx is an uncommon name.
-Thorsten
Jonathan