From fcbd984e0fcfe1fae75ec6338d6d08f3e93f4c34 Mon Sep 17 00:00:00 2001 From: Niels Date: Wed, 23 Dec 2015 08:44:34 +0100 Subject: [PATCH] cleanup --- src/json.hpp | 48 +++++++++++++++++++++++++---------------------- src/json.hpp.re2c | 48 +++++++++++++++++++++++++---------------------- 2 files changed, 52 insertions(+), 44 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index ef5076533..54b802c22 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -3767,6 +3767,32 @@ class basic_json return const_reverse_iterator(cbegin()); } + private: + // forward declaration + template class iteration_proxy; + + public: + /*! + @brief wrapper to access iterator member functions in range-based for + + This functuion allows to access @ref iterator::key() and @ref + iterator::value() during range-based for loops. In these loops, a reference + to the JSON values is returned, so there is no access to the underlying + iterator. + */ + static iteration_proxy iterator_wrapper(reference cont) + { + return iteration_proxy(cont); + } + + /*! + @copydoc iterator_wrapper(reference) + */ + static iteration_proxy iterator_wrapper(const_reference cont) + { + return iteration_proxy(cont); + } + /// @} @@ -6248,28 +6274,6 @@ class basic_json } }; - public: - /*! - @brief wrapper to access iterator member functions in range-based for - - This functuion allows to access @ref iterator::key() and @ref - iterator::value() during range-based for loops. In these loops, a reference - to the JSON values is returned, so there is no access to the underlying - iterator. - */ - static iteration_proxy iterator_wrapper(reference cont) - { - return iteration_proxy(cont); - } - - /*! - @copydoc iterator_wrapper(reference) - */ - static iteration_proxy iterator_wrapper(const_reference cont) - { - return iteration_proxy(cont); - } - private: ////////////////////// diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index d3d9f15a9..053713823 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -3767,6 +3767,32 @@ class basic_json return const_reverse_iterator(cbegin()); } + private: + // forward declaration + template class iteration_proxy; + + public: + /*! + @brief wrapper to access iterator member functions in range-based for + + This functuion allows to access @ref iterator::key() and @ref + iterator::value() during range-based for loops. In these loops, a reference + to the JSON values is returned, so there is no access to the underlying + iterator. + */ + static iteration_proxy iterator_wrapper(reference cont) + { + return iteration_proxy(cont); + } + + /*! + @copydoc iterator_wrapper(reference) + */ + static iteration_proxy iterator_wrapper(const_reference cont) + { + return iteration_proxy(cont); + } + /// @} @@ -6248,28 +6274,6 @@ class basic_json } }; - public: - /*! - @brief wrapper to access iterator member functions in range-based for - - This functuion allows to access @ref iterator::key() and @ref - iterator::value() during range-based for loops. In these loops, a reference - to the JSON values is returned, so there is no access to the underlying - iterator. - */ - static iteration_proxy iterator_wrapper(reference cont) - { - return iteration_proxy(cont); - } - - /*! - @copydoc iterator_wrapper(reference) - */ - static iteration_proxy iterator_wrapper(const_reference cont) - { - return iteration_proxy(cont); - } - private: //////////////////////