summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2013-09-16 20:16:37 (GMT)
committerRemko Tronçon <git@el-tramo.be>2013-09-17 18:25:40 (GMT)
commit4a8cf892743284265bcc8bf9c6fbc4747aa86089 (patch)
treeff223fa5638790d9f0643ddf8baf8c50f68f3186 /Swiften/Elements
parent56a3f51b12b4fc2328cb76be58d623eb5a1f63e4 (diff)
downloadswift-4a8cf892743284265bcc8bf9c6fbc4747aa86089.zip
swift-4a8cf892743284265bcc8bf9c6fbc4747aa86089.tar.bz2
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
Diffstat (limited to 'Swiften/Elements')
-rw-r--r--Swiften/Elements/Message.h4
1 files changed, 3 insertions, 1 deletions
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>(subject));
}
+ // Explicitly convert to bool. In C++11, it would be cleaner to
+ // compare to nullptr.
bool hasSubject() {
- return getPayload<Subject>();
+ return static_cast<bool>(getPayload<Subject>());
}
std::string getBody() const {