I've read that it's possible to read cin via an ifstream by changing the buffer, but is it safe? What are the disadvantages to doing it this way:
file.ios::rdbuf(cin.rdbuf());
Thanks
C++: UNIX - defaulting ifstream variable to standard input
iostream - C++: assign cin to an ifstream variable? - Stack Overflow