------- Comment #1 from pinskia at gcc dot gnu dot org 2010-09-01 21:36 ------- On the trunk we get:
t.cc: In function âvoid foo()â: t.cc:9:39: error: no matching function for call to âdistance(foo()::my_iter, foo()::my_iter)â /home/apinski/local-gcc/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/stl_iterator_base_funcs.h:111:59: note: candidate is: template<class _InputIterator> typename std::iterator_traits::difference_type std::distance(_InputIterator, _InputIterator) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45490