summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-06-12 19:41:19 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-06-12 19:41:19 (GMT)
commit75025326ec13a76cb2a724380bf7569aa6dc6ecf (patch)
treef05bd81ad6177cda51f20e559745f62ac7d27ab9 /Swiften/Elements/Presence.h
parent29a83617e0a066ee0692d2bbcecc9335f73b8138 (diff)
downloadswift-contrib-75025326ec13a76cb2a724380bf7569aa6dc6ecf.zip
swift-contrib-75025326ec13a76cb2a724380bf7569aa6dc6ecf.tar.bz2
Replace explicit new with make_shared.
Diffstat (limited to 'Swiften/Elements/Presence.h')
-rw-r--r--Swiften/Elements/Presence.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/Swiften/Elements/Presence.h b/Swiften/Elements/Presence.h
index 5ae482b..28a9ee5 100644
--- a/Swiften/Elements/Presence.h
+++ b/Swiften/Elements/Presence.h
@@ -6,6 +6,8 @@
#pragma once
+#include <boost/smart_ptr/make_shared.hpp>
+
#include <Swiften/Elements/Stanza.h>
#include <Swiften/Elements/StatusShow.h>
@@ -21,15 +23,15 @@ namespace Swift {
virtual ~Presence();
static ref create() {
- return ref(new Presence());
+ return boost::make_shared<Presence>();
}
static ref create(const std::string& status) {
- return ref(new Presence(status));
+ return boost::make_shared<Presence>(status);
}
static ref create(Presence::ref presence) {
- return ref(new Presence(*presence));
+ return boost::make_shared<Presence>(*presence);
}
Type getType() const { return type_; }
@@ -44,7 +46,7 @@ namespace Swift {
}
void setShow(const StatusShow::Type &show) {
- updatePayload(boost::shared_ptr<StatusShow>(new StatusShow(show)));
+ updatePayload(boost::make_shared<StatusShow>(show));
}
std::string getStatus() const;
@@ -54,7 +56,7 @@ namespace Swift {
void setPriority(int priority);
boost::shared_ptr<Presence> clone() const {
- return boost::shared_ptr<Presence>(new Presence(*this));
+ return boost::make_shared<Presence>(*this);
}
bool isAvailable() const {