use boost::iterator_range instead of homebrew hack
more const