Why doesn't range-for find my overloads of begin and end for std::istream_iterator?
问题 I have code like this std::ifstream file(filename, std::ios_base::in); if(file.good()) { file.imbue(std::locale(std::locale(), new delimeter_tokens())); for(auto& entry : std::istream_iterator<std::string>(file)) { std::cout << entry << std::endl; } } file.close(); where std::istream_iterator<std::string> 's begin() and end() are defined as follows template<class T> std::istream_iterator<T> begin(std::istream_iterator<T>& stream) { return stream; } template<class T> std::istream_iterator<T>