In my code I am passed a reference to an iostream, that in this case is ultimately a file.
Is there any way to find out if, when it was opened, it was set to [in|out] not just [in]?
After looking at all the members of IOS, iostream, ostream, i did not see any way to retrieve the openmode
flag used. I guess you'll have to try to write something to your reference and catch any error it throws. Or depending on how it is set, check the result of bad().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With