From a23076d7bb12e5566b16582cbf82ab364cda2669 Mon Sep 17 00:00:00 2001 From: Vittorio Romeo Date: Thu, 9 Dec 2021 01:55:49 +0000 Subject: [PATCH] Replace 'BoolType' with 'explicit operator bool' --- include/SFML/Network/Packet.hpp | 5 +---- src/SFML/Network/Packet.cpp | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/SFML/Network/Packet.hpp b/include/SFML/Network/Packet.hpp index 2f7ea123a..e97607c33 100644 --- a/include/SFML/Network/Packet.hpp +++ b/include/SFML/Network/Packet.hpp @@ -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 diff --git a/src/SFML/Network/Packet.cpp b/src/SFML/Network/Packet.cpp index 89508dbb1..ef422f7bc 100644 --- a/src/SFML/Network/Packet.cpp +++ b/src/SFML/Network/Packet.cpp @@ -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; }