c++ - Reuse istream_iterator variable -


i using 2 iterators read text file vector:

std::ifstream input_file("~/blahblah.txt"); std::istream_iterator<float> start(input_file),end; std::vector<float> testframefloat(start,end); input_file.close();input_file.clear(); 

and then, use same ifstream read text file. possible reuse same istream_iterators instead of creating new ones? getting compilation errors if try so:

input_file.open("~/anothertext.txt"); start(input_file); //this compilation error std::vector<float> readvalues(start,end); 


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -