I would like my application to use std::cin and std::cout, but with the possibility to pass file names as arguments : my_app -i input_file -o outputfile
This is mainly to separate debug & release settings : I need to have a debug setting with files, and a release one with std::in/out. In the debug setting, while I use a file in place of std::cin, I want to keep std::cin as usual, for valgrind profiling tool interraction. So solutions with total redirection like freopen are not relevant for my use case.
$ myPrg // This reads/prints to/from console
$ myPrg >input.txt //This reads from console and prints to intput.txt
$ myPrg <intput.txt //read from input, print to console
$ myPrg <intput.txt >output.txt //input.txt to output.txt