Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/yaml-cpp/node/detail/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class YAML_CPP_API memory {

class YAML_CPP_API memory_holder {
public:
memory_holder() : m_pMemory(new memory) {}
memory_holder() : m_pMemory(std::make_shared<memory>()) {}

node& create_node() { return m_pMemory->create_node(); }
void merge(memory_holder& rhs);
Expand Down
2 changes: 1 addition & 1 deletion include/yaml-cpp/node/detail/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class node {
};

public:
node() : m_pRef(new node_ref), m_dependencies{}, m_index{} {}
node() : m_pRef(std::make_shared<node_ref>()), m_dependencies{}, m_index{} {}
node(const node&) = delete;
node& operator=(const node&) = delete;

Expand Down
2 changes: 1 addition & 1 deletion include/yaml-cpp/node/detail/node_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace YAML {
namespace detail {
class node_ref {
public:
node_ref() : m_pData(new node_data) {}
node_ref() : m_pData(std::make_shared<node_data>()) {}
node_ref(const node_ref&) = delete;
node_ref& operator=(const node_ref&) = delete;

Expand Down
4 changes: 2 additions & 2 deletions include/yaml-cpp/node/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ inline Node::Node()
inline Node::Node(NodeType::value type)
: m_isValid(true),
m_invalidKey{},
m_pMemory(new detail::memory_holder),
m_pMemory(std::make_shared<detail::memory_holder>()),
m_pNode(&m_pMemory->create_node()) {
m_pNode->set_type(type);
}
Expand All @@ -31,7 +31,7 @@ template <typename T>
inline Node::Node(const T& rhs)
: m_isValid(true),
m_invalidKey{},
m_pMemory(new detail::memory_holder),
m_pMemory(std::make_shared<detail::memory_holder>()),
m_pNode(&m_pMemory->create_node()) {
Assign(rhs);
}
Expand Down
2 changes: 1 addition & 1 deletion src/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void memory_holder::merge(memory_holder& rhs) {
}

node& memory::create_node() {
shared_node pNode(new node);
shared_node pNode(std::make_shared<node>());
m_nodes.insert(pNode);
return *pNode;
}
Expand Down
2 changes: 1 addition & 1 deletion src/nodebuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace YAML {
struct Mark;

NodeBuilder::NodeBuilder()
: m_pMemory(new detail::memory_holder),
: m_pMemory(std::make_shared<detail::memory_holder>()),
m_pRoot(nullptr),
m_stack{},
m_anchors{},
Expand Down
Loading