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]?
In my code I am passed a reference to an iostream, that in this
Share
After looking at all the members of IOS, iostream, ostream, i did not see any way to retrieve the
openmodeflag 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().