Who'd need that??
Everyone :
float x;
packet >> x;
if (!packet)
{
// error reading x
}
// Or, another style:
float x
if (packet >> x)
{
// ok, can proceed with x
}
This is a standard idiom : try to read, and then check if it was successful.
Checking before reading would be a non-sense as it depends on the variable itself : imagine there's one byte left to read in the packet, then you can extract a char but not an int. No class behaves like this.
By the way, this is the exact same behaviour as standard C++ streams.
So if this is really intended by you then I request a function either
bool IsReadable()
or
uint32_t GetRemainingSize()
There's a bool EndOfPacket() function, actually (in SVN version). But again, checking before reading is a mistake. This function should only be used to report an error or warning if there are unread bytes left.