From 3e65a652905610f0cc28109ad35a911befdb2b61 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Th=C3=A9o=20DELRIEU?= <delrieutheo@gmail.com>
Date: Mon, 14 Aug 2017 17:18:07 +0200
Subject: [PATCH] add detail/iterators/internal_iterator.hpp

---
 Makefile                                   |  3 ++-
 src/detail/iterators/internal_iterator.hpp | 28 ++++++++++++++++++++++
 src/json.hpp                               | 17 +------------
 3 files changed, 31 insertions(+), 17 deletions(-)
 create mode 100644 src/detail/iterators/internal_iterator.hpp

diff --git a/Makefile b/Makefile
index 4f5e9249f..d587f051b 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,8 @@ SRCS = ${SRCDIR}/json.hpp \
 			 ${SRCDIR}/detail/parsing/input_adapters.hpp \
 			 ${SRCDIR}/detail/parsing/lexer.hpp \
 			 ${SRCDIR}/detail/parsing/parser.hpp \
-			 ${SRCDIR}/detail/iterators/primitive_iterator.hpp
+			 ${SRCDIR}/detail/iterators/primitive_iterator.hpp \
+			 ${SRCDIR}/detail/iterators/internal_iterator.hpp
 
 
 
diff --git a/src/detail/iterators/internal_iterator.hpp b/src/detail/iterators/internal_iterator.hpp
new file mode 100644
index 000000000..257633557
--- /dev/null
+++ b/src/detail/iterators/internal_iterator.hpp
@@ -0,0 +1,28 @@
+#ifndef NLOHMANN_JSON_DETAIL_ITERATORS_INTERNAL_ITERATOR_HPP
+#define NLOHMANN_JSON_DETAIL_ITERATORS_INTERNAL_ITERATOR_HPP
+
+#include "detail/iterators/primitive_iterator.hpp"
+
+namespace nlohmann
+{
+namespace detail
+{
+/*!
+@brief an iterator value
+
+@note This structure could easily be a union, but MSVC currently does not allow
+unions members with complex constructors, see https://github.com/nlohmann/json/pull/105.
+*/
+template<typename BasicJsonType> struct internal_iterator
+{
+    /// iterator for JSON objects
+    typename BasicJsonType::object_t::iterator object_iterator {};
+    /// iterator for JSON arrays
+    typename BasicJsonType::array_t::iterator array_iterator {};
+    /// generic iterator for all other types
+    primitive_iterator_t primitive_iterator {};
+};
+}
+}
+
+#endif
diff --git a/src/json.hpp b/src/json.hpp
index 3d4eddd30..561761dc3 100644
--- a/src/json.hpp
+++ b/src/json.hpp
@@ -61,6 +61,7 @@ SOFTWARE.
 #include "detail/parsing/lexer.hpp"
 #include "detail/parsing/parser.hpp"
 #include "detail/iterators/primitive_iterator.hpp"
+#include "detail/iterators/internal_iterator.hpp"
 
 /*!
 @brief namespace for Niels Lohmann
@@ -75,22 +76,6 @@ namespace detail
 // iterators //
 ///////////////
 
-/*!
-@brief an iterator value
-
-@note This structure could easily be a union, but MSVC currently does not allow
-unions members with complex constructors, see https://github.com/nlohmann/json/pull/105.
-*/
-template<typename BasicJsonType> struct internal_iterator
-{
-    /// iterator for JSON objects
-    typename BasicJsonType::object_t::iterator object_iterator {};
-    /// iterator for JSON arrays
-    typename BasicJsonType::array_t::iterator array_iterator {};
-    /// generic iterator for all other types
-    primitive_iterator_t primitive_iterator {};
-};
-
 template<typename IteratorType> class iteration_proxy;
 
 /*!