From e3ab0bc74ac48cea773a11b88dd42429a1b3eab0 Mon Sep 17 00:00:00 2001 From: Niels Date: Sat, 25 Apr 2015 23:10:23 +0200 Subject: [PATCH] addressing issue #62 --- src/json.hpp | 64 +++++++++++------------------------------------ src/json.hpp.re2c | 64 +++++++++++------------------------------------ 2 files changed, 28 insertions(+), 100 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index a61ad51b7..663fb3085 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -11,6 +11,7 @@ #define _NLOHMANN_JSON #include +#include #include #include #include @@ -86,40 +87,19 @@ class basic_json // container types // ///////////////////// - // forward declarations - class iterator; - class const_iterator; - class reverse_iterator; - class const_reverse_iterator; - - /*! - @brief the type of elements in a basic_json container - @ingroup container - */ + /// the type of elements in a basic_json container using value_type = basic_json; - /*! - @brief the type of an element reference - @ingroup container - */ + /// the type of an element reference using reference = value_type&; - /*! - @brief the type of an element const reference - @ingroup container - */ + /// the type of an element const reference using const_reference = const value_type&; - /*! - @brief a type to represent differences between iterators - @ingroup container - */ + /// a type to represent differences between iterators using difference_type = std::ptrdiff_t; - /*! - @brief a type to represent container sizes - @ingroup container - */ + /// a type to represent container sizes using size_type = std::size_t; /// the allocator type @@ -130,30 +110,14 @@ class basic_json /// the type of an element const pointer using const_pointer = typename std::allocator_traits::const_pointer; - /*! - @brief an iterator for a basic_json container - @ingroup container - */ - using iterator = basic_json::iterator; - - /*! - @brief a const iterator for a basic_json container - @ingroup container - */ - using const_iterator = basic_json::const_iterator; - - /*! - @brief a reverse iterator for a basic_json container - @ingroup reversiblecontainer - */ - using reverse_iterator = basic_json::reverse_iterator; - - /*! - @brief a const reverse iterator for a basic_json container - @ingroup reversiblecontainer - */ - using const_reverse_iterator = basic_json::const_reverse_iterator; - + /// an iterator for a basic_json container + class iterator; + /// a const iterator for a basic_json container + class const_iterator; + /// a reverse iterator for a basic_json container + class reverse_iterator; + /// a const reverse iterator for a basic_json container + class const_reverse_iterator; /// returns the allocator associated with the container inline static allocator_type get_allocator() diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 3677557ba..b1de19339 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -11,6 +11,7 @@ #define _NLOHMANN_JSON #include +#include #include #include #include @@ -86,40 +87,19 @@ class basic_json // container types // ///////////////////// - // forward declarations - class iterator; - class const_iterator; - class reverse_iterator; - class const_reverse_iterator; - - /*! - @brief the type of elements in a basic_json container - @ingroup container - */ + /// the type of elements in a basic_json container using value_type = basic_json; - /*! - @brief the type of an element reference - @ingroup container - */ + /// the type of an element reference using reference = value_type&; - /*! - @brief the type of an element const reference - @ingroup container - */ + /// the type of an element const reference using const_reference = const value_type&; - /*! - @brief a type to represent differences between iterators - @ingroup container - */ + /// a type to represent differences between iterators using difference_type = std::ptrdiff_t; - /*! - @brief a type to represent container sizes - @ingroup container - */ + /// a type to represent container sizes using size_type = std::size_t; /// the allocator type @@ -130,30 +110,14 @@ class basic_json /// the type of an element const pointer using const_pointer = typename std::allocator_traits::const_pointer; - /*! - @brief an iterator for a basic_json container - @ingroup container - */ - using iterator = basic_json::iterator; - - /*! - @brief a const iterator for a basic_json container - @ingroup container - */ - using const_iterator = basic_json::const_iterator; - - /*! - @brief a reverse iterator for a basic_json container - @ingroup reversiblecontainer - */ - using reverse_iterator = basic_json::reverse_iterator; - - /*! - @brief a const reverse iterator for a basic_json container - @ingroup reversiblecontainer - */ - using const_reverse_iterator = basic_json::const_reverse_iterator; - + /// an iterator for a basic_json container + class iterator; + /// a const iterator for a basic_json container + class const_iterator; + /// a reverse iterator for a basic_json container + class reverse_iterator; + /// a const reverse iterator for a basic_json container + class const_reverse_iterator; /// returns the allocator associated with the container inline static allocator_type get_allocator()