How does one determine the sizeof a pos_type or offset_type such as is used in c++ stream i/o. You can't just write sizeof(pos_type) or sizeof(basic_streambuf::pos_type) because it is defined somehow inside a template that ... well, it's pretty complex.
It would be nice to know this at compile time.
BTW, there is a type called "streamsize" that seems to fit the bill, but sizeof(streamsize) is not a valid preprocessor term.
basic_streambuf is a template class. It is not fully defined until you use it. Use
sizeof for members of template specialization, e.g. for
You need to use sizeof on an instantiation of the template.