From db35e99d3c72dda5979150471f5fdbb7d259e9ef Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 11 Nov 2020 18:51:46 +0200 Subject: [PATCH] Fix reference types in iterators Amends 26faac387c237ccac75a56925c6858baf8ccda1b. --- include/yaml-cpp/node/detail/iterator.h | 2 +- include/yaml-cpp/node/detail/node_iterator.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/yaml-cpp/node/detail/iterator.h b/include/yaml-cpp/node/detail/iterator.h index 997c69a14..04d2da4fc 100644 --- a/include/yaml-cpp/node/detail/iterator.h +++ b/include/yaml-cpp/node/detail/iterator.h @@ -41,7 +41,7 @@ class iterator_base { using value_type = V; using difference_type = std::ptrdiff_t; using pointer = V*; - using reference = V; + using reference = V&; public: iterator_base() : m_iterator(), m_pMemory() {} diff --git a/include/yaml-cpp/node/detail/node_iterator.h b/include/yaml-cpp/node/detail/node_iterator.h index 49dcf958d..6eb4ddc13 100644 --- a/include/yaml-cpp/node/detail/node_iterator.h +++ b/include/yaml-cpp/node/detail/node_iterator.h @@ -69,7 +69,7 @@ class node_iterator_base { using value_type = node_iterator_value; using difference_type = std::ptrdiff_t; using pointer = node_iterator_value*; - using reference = node_iterator_value; + using reference = node_iterator_value&; using SeqIter = typename node_iterator_type::seq; using MapIter = typename node_iterator_type::map;