Replace 'BoolType' with 'explicit operator bool'

This commit is contained in:
Vittorio Romeo 2021-12-09 01:55:49 +00:00 committed by Lukas Dürrenberger
parent 87e84bc9e5
commit a23076d7bb
2 changed files with 3 additions and 6 deletions

View File

@ -46,9 +46,6 @@ class UdpSocket;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
class SFML_NETWORK_API Packet class SFML_NETWORK_API Packet
{ {
// A bool-like type that cannot be converted to integer or pointer types
using BoolType = bool (Packet::*)(std::size_t);
public: public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -181,7 +178,7 @@ public:
/// \see endOfPacket /// \see endOfPacket
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
operator BoolType() const; explicit operator bool() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Overload of operator >> to read data from the packet /// Overload of operator >> to read data from the packet

View File

@ -101,9 +101,9 @@ bool Packet::endOfPacket() const
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Packet::operator BoolType() const Packet::operator bool() const
{ {
return m_isValid ? &Packet::checkSize : nullptr; return m_isValid;
} }