When dealing with files, which of the two examples below is preferred?
Does one provide better performance than the other? Is there any difference at all?
Just use the more concise form unless you need different behaviour... to do otherwise is just to create room for more errors. FWIW, when possible I prefer to scope the stream and check the open worked like this:
if (std::ifstream input{"input_file.txt"})
...use input...
else
...log and/or throw...