From 5a5324ed3a381a86dfe0a6e3932c1d58fdcd596f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 21 Jun 2016 01:14:06 +0100 Subject: Use make_shared<>. --- src/lib/subtitle_content.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib/subtitle_content.cc') diff --git a/src/lib/subtitle_content.cc b/src/lib/subtitle_content.cc index 5b3b453b6..9fd49831f 100644 --- a/src/lib/subtitle_content.cc +++ b/src/lib/subtitle_content.cc @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "i18n.h" @@ -37,6 +38,7 @@ using std::vector; using std::cout; using std::list; using boost::shared_ptr; +using boost::make_shared; using boost::dynamic_pointer_cast; int const SubtitleContentProperty::X_OFFSET = 500; @@ -84,6 +86,7 @@ SubtitleContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version return shared_ptr (); } + /* Can't use make_shared here as the constructor is private */ return shared_ptr (new SubtitleContent (parent, node, version)); } @@ -130,7 +133,7 @@ SubtitleContent::SubtitleContent (Content* parent, cxml::ConstNodePtr node, int list fonts = node->node_children ("Font"); for (list::const_iterator i = fonts.begin(); i != fonts.end(); ++i) { - _fonts.push_back (shared_ptr (new Font (*i))); + _fonts.push_back (make_shared (*i)); } connect_to_fonts (); -- cgit v1.2.3