I'm converting my code to follow the google C++ style guide. The Reference Arguments rule says "All parameters passed by reference must be labeled const" and "input arguments are values or const references while output arguments are pointers".
With respect to the signature void MyTable::LoadTable(ifstream &fin)
, how can I label the parameter fin
const
given LoadTable
invokes some non-const function of fin
, e.g. fin.seekg
? I think fin
should be regarded as an input/output parameter thus it's a little bit special. What will googlers do in this situation?
UPDATE: I knew there are lots of criticisms about the google style guide. I just wondered how googlers tackle it, and maybe I found an answer: there is another rule Streams reading "Use streams only for logging". Maybe they just don't use streams in this situation.