From dc215eddf655a46bd06680ef98bcff4d97bd89bf Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Wed, 12 Sep 2018 09:25:32 +0700 Subject: [PATCH] fix requested items --- include/yaml-cpp/node/detail/node_data.h | 2 +- src/node_data.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/yaml-cpp/node/detail/node_data.h b/include/yaml-cpp/node/detail/node_data.h index f8e4036..82fb79a 100644 --- a/include/yaml-cpp/node/detail/node_data.h +++ b/include/yaml-cpp/node/detail/node_data.h @@ -81,7 +81,7 @@ class YAML_CPP_API node_data { shared_memory_holder pMemory); public: - static std::string& empty_scalar(); + static const std::string& empty_scalar(); private: void compute_seq_size() const; diff --git a/src/node_data.cpp b/src/node_data.cpp index d0ca26b..b74a112 100644 --- a/src/node_data.cpp +++ b/src/node_data.cpp @@ -13,9 +13,9 @@ namespace YAML { namespace detail { -std::string& node_data::empty_scalar(){ - static std::string _es; - return _es ; +const std::string& node_data::empty_scalar() { + static const std::string svalue; + return svalue ; } node_data::node_data()