id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 8617,Surprising/wrong semantics of counting_range,pbazant@…,Neil Groves,"I would expect counting_range(begin(rng),end(rng)); to be equivalent to counting_range(rng); which does not seem to be the case. The code in the library looks like it constructs the range from the first and last _value_ of the rng: template inline iterator_range::type> > counting_range(Range& rng) { typedef counting_iterator::type> counting_iterator_t; typedef iterator_range result_t; return boost::empty(rng) ? result_t() : result_t( counting_iterator_t(*boost::begin(rng)), counting_iterator_t(*boost::prior(boost::end(rng)))); } I want to be able to use the counting range in a range based for like this: for(auto it : counting_range(rng | indexed(0))) { *it; it.index(); } I also vote for a way to use indexed adaptor in the range based for loop directly. The model for the new indexed adaptor could be something like enumerate() in Python. Much much nicer than using a counter variable. ",Bugs,closed,To Be Determined,range,Boost 1.53.0,Problem,fixed,range,