Replace 'BoolType' with 'explicit operator bool'
This commit is contained in:
parent
87e84bc9e5
commit
a23076d7bb
@ -46,9 +46,6 @@ class UdpSocket;
|
||||
////////////////////////////////////////////////////////////
|
||||
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:
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@ -181,7 +178,7 @@ public:
|
||||
/// \see endOfPacket
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
operator BoolType() const;
|
||||
explicit operator bool() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Overload of operator >> to read data from the packet
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user