I was going through the implementation of seekpos
in the source of streambuf in the gnu online doc. I couldn't understand why __mode
is commented in the line ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out
and why it doesn't throw an error.
virtual pos_type
seekpos(pos_type, ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out)
{
return pos_type(off_type(-1));
}
I can understand the usage of the comment, if it was of the following format :
void foo( pos_type, int /*blah*/ ){
...
}
But, in the former case, there is also an intention to assign something to __mode
, hence my surprise on not getting any error there.
Is this allowed? If yes, then why ?