They ARE the same, since ifstream
inherit from ios
...
There is no "idiom" there. Just opinions.
My personal one is that you shold protect you code in a way a change in the library it uses will retain you code consistency.
So your_file_stream.end
is always coherent to your_file_stream
whatever it is and however it is composed in present and future versions. And even if it happens to be different respect to other stream types, will always work.
If you don't have an instance, std::ifstream::binary
is always coherent with ifstream
, however it will be composed now and in the future. And will word even if it will be different from other types.
If you're writing a polymorphic runtime-function taking std::ios&
, than std::ios::binary
is fine.
However it will be unlikely those things will ever be changed, so ... it does not really matters.