Implemented the sf::Packet to bool conversion using the safe-bool idiom

This commit is contained in:
Laurent Gomila 2011-05-25 20:45:16 +02:00
parent 43d4d0bb28
commit 94ab420dd3
2 changed files with 19 additions and 3 deletions

View file

@ -92,9 +92,9 @@ bool Packet::EndOfPacket() const
////////////////////////////////////////////////////////////
Packet::operator void*() const
Packet::operator BoolType() const
{
return myIsValid ? const_cast<Packet*>(this) : NULL;
return myIsValid ? &Packet::CheckSize : NULL;
}