From 4a8cf892743284265bcc8bf9c6fbc4747aa86089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Mon, 16 Sep 2013 22:16:37 +0200 Subject: Don't use implicit bool conversion on shared_ptr C++11 doesn't have implicit conversion to bool on shared_ptr. The cleanest fix is to compare against nullptr, but this only works on C++11. Change-Id: Ia2b4b5d90f99aa24c4f3bdf0d680343754e32ec2 diff --git a/Swiften/Client/ClientSession.h b/Swiften/Client/ClientSession.h index 6ef624e..4b944fc 100644 --- a/Swiften/Client/ClientSession.h +++ b/Swiften/Client/ClientSession.h @@ -94,7 +94,9 @@ namespace Swift { bool getStreamManagementEnabled() const { - return stanzaAckRequester_; + // Explicitly convert to bool. In C++11, it would be cleaner to + // compare to nullptr. + return static_cast(stanzaAckRequester_); } bool getRosterVersioningSupported() const { diff --git a/Swiften/Elements/Message.h b/Swiften/Elements/Message.h index 3b9145c..ea99814 100644 --- a/Swiften/Elements/Message.h +++ b/Swiften/Elements/Message.h @@ -38,8 +38,10 @@ namespace Swift { updatePayload(boost::make_shared(subject)); } + // Explicitly convert to bool. In C++11, it would be cleaner to + // compare to nullptr. bool hasSubject() { - return getPayload(); + return static_cast(getPayload()); } std::string getBody() const { -- cgit v0.10.2-6-g49f6