From 7381b197f721e4e38ead259ea5811aab8344f7fe Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 2 Jul 2023 21:57:31 +0200 Subject: Cleanup: use some make_shared. --- src/cxml.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cxml.cc b/src/cxml.cc index c2d8534..b065b37 100644 --- a/src/cxml.cc +++ b/src/cxml.cc @@ -24,11 +24,14 @@ #include #include + +using std::make_shared; using std::shared_ptr; using std::string; using std::vector; using boost::optional; + cxml::Node::Node () : _node (nullptr) { @@ -85,7 +88,7 @@ cxml::Node::node_children () const vector> n; for (auto i: _node->get_children()) { - n.push_back (shared_ptr (new Node (i))); + n.push_back(make_shared(i)); } return n; @@ -105,7 +108,7 @@ cxml::Node::node_children (string name) const vector> n; for (auto i: _node->get_children()) { if (i->get_name() == name) { - n.push_back (shared_ptr (new Node (i))); + n.push_back(make_shared(i)); } } -- cgit v1.2.3