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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -