blob: d9160856c47fb88ffd38317f84ed097c281b8739 (
plain)
1 commit f5f288c7622d3547c29a8355b8ccda0155483b79
2 Author: Till Hofmann <hofmann@kbsg.rwth-aachen.de>
3 Date: Sun Nov 17 22:43:20 2019 +0100
4
5 Revert "fix up static, so works as DLL (#559)"
6
7 This reverts commit 774f25800e6f19f4b927023c85d1389af322da5e.
8
9 diff --git a/include/yaml-cpp/node/detail/node_data.h b/include/yaml-cpp/node/detail/node_data.h
10 index 82fb79a..50bcd74 100644
11 --- a/include/yaml-cpp/node/detail/node_data.h
12 +++ b/include/yaml-cpp/node/detail/node_data.h
13 @@ -81,7 +81,7 @@ class YAML_CPP_API node_data {
14 shared_memory_holder pMemory);
15
16 public:
17 - static const std::string& empty_scalar();
18 + static std::string empty_scalar;
19
20 private:
21 void compute_seq_size() const;
22 diff --git a/include/yaml-cpp/node/impl.h b/include/yaml-cpp/node/impl.h
23 index 7a3deac..b363f86 100644
24 --- a/include/yaml-cpp/node/impl.h
25 +++ b/include/yaml-cpp/node/impl.h
26 @@ -166,13 +166,13 @@ inline T Node::as(const S& fallback) const {
27 inline const std::string& Node::Scalar() const {
28 if (!m_isValid)
29 throw InvalidNode(m_invalidKey);
30 - return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar();
31 + return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar;
32 }
33
34 inline const std::string& Node::Tag() const {
35 if (!m_isValid)
36 throw InvalidNode(m_invalidKey);
37 - return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar();
38 + return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar;
39 }
40
41 inline void Node::SetTag(const std::string& tag) {
42 diff --git a/src/node_data.cpp b/src/node_data.cpp
43 index 6cfedfc..eba1ae4 100644
44 --- a/src/node_data.cpp
45 +++ b/src/node_data.cpp
46 @@ -13,10 +13,7 @@
47 namespace YAML {
48 namespace detail {
49
50 -const std::string& node_data::empty_scalar() {
51 - static const std::string svalue;
52 - return svalue;
53 -}
54 +std::string node_data::empty_scalar;
55
56 node_data::node_data()
57 : m_isDefined(false),
|