addressing issue #62

This commit is contained in:
Niels 2015-04-25 23:10:23 +02:00
parent 89a8491914
commit e3ab0bc74a
2 changed files with 28 additions and 100 deletions

View File

@ -11,6 +11,7 @@
#define _NLOHMANN_JSON #define _NLOHMANN_JSON
#include <algorithm> #include <algorithm>
#include <ciso646>
#include <cmath> #include <cmath>
#include <cstdio> #include <cstdio>
#include <functional> #include <functional>
@ -86,40 +87,19 @@ class basic_json
// container types // // container types //
///////////////////// /////////////////////
// forward declarations /// the type of elements in a basic_json container
class iterator;
class const_iterator;
class reverse_iterator;
class const_reverse_iterator;
/*!
@brief the type of elements in a basic_json container
@ingroup container
*/
using value_type = basic_json; using value_type = basic_json;
/*! /// the type of an element reference
@brief the type of an element reference
@ingroup container
*/
using reference = value_type&; using reference = value_type&;
/*! /// the type of an element const reference
@brief the type of an element const reference
@ingroup container
*/
using const_reference = const value_type&; using const_reference = const value_type&;
/*! /// a type to represent differences between iterators
@brief a type to represent differences between iterators
@ingroup container
*/
using difference_type = std::ptrdiff_t; using difference_type = std::ptrdiff_t;
/*! /// a type to represent container sizes
@brief a type to represent container sizes
@ingroup container
*/
using size_type = std::size_t; using size_type = std::size_t;
/// the allocator type /// the allocator type
@ -130,30 +110,14 @@ class basic_json
/// the type of an element const pointer /// the type of an element const pointer
using const_pointer = typename std::allocator_traits<allocator_type>::const_pointer; using const_pointer = typename std::allocator_traits<allocator_type>::const_pointer;
/*! /// an iterator for a basic_json container
@brief an iterator for a basic_json container class iterator;
@ingroup container /// a const iterator for a basic_json container
*/ class const_iterator;
using iterator = basic_json::iterator; /// a reverse iterator for a basic_json container
class reverse_iterator;
/*! /// a const reverse iterator for a basic_json container
@brief a const iterator for a basic_json container class const_reverse_iterator;
@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;
/// returns the allocator associated with the container /// returns the allocator associated with the container
inline static allocator_type get_allocator() inline static allocator_type get_allocator()

View File

@ -11,6 +11,7 @@
#define _NLOHMANN_JSON #define _NLOHMANN_JSON
#include <algorithm> #include <algorithm>
#include <ciso646>
#include <cmath> #include <cmath>
#include <cstdio> #include <cstdio>
#include <functional> #include <functional>
@ -86,40 +87,19 @@ class basic_json
// container types // // container types //
///////////////////// /////////////////////
// forward declarations /// the type of elements in a basic_json container
class iterator;
class const_iterator;
class reverse_iterator;
class const_reverse_iterator;
/*!
@brief the type of elements in a basic_json container
@ingroup container
*/
using value_type = basic_json; using value_type = basic_json;
/*! /// the type of an element reference
@brief the type of an element reference
@ingroup container
*/
using reference = value_type&; using reference = value_type&;
/*! /// the type of an element const reference
@brief the type of an element const reference
@ingroup container
*/
using const_reference = const value_type&; using const_reference = const value_type&;
/*! /// a type to represent differences between iterators
@brief a type to represent differences between iterators
@ingroup container
*/
using difference_type = std::ptrdiff_t; using difference_type = std::ptrdiff_t;
/*! /// a type to represent container sizes
@brief a type to represent container sizes
@ingroup container
*/
using size_type = std::size_t; using size_type = std::size_t;
/// the allocator type /// the allocator type
@ -130,30 +110,14 @@ class basic_json
/// the type of an element const pointer /// the type of an element const pointer
using const_pointer = typename std::allocator_traits<allocator_type>::const_pointer; using const_pointer = typename std::allocator_traits<allocator_type>::const_pointer;
/*! /// an iterator for a basic_json container
@brief an iterator for a basic_json container class iterator;
@ingroup container /// a const iterator for a basic_json container
*/ class const_iterator;
using iterator = basic_json::iterator; /// a reverse iterator for a basic_json container
class reverse_iterator;
/*! /// a const reverse iterator for a basic_json container
@brief a const iterator for a basic_json container class const_reverse_iterator;
@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;
/// returns the allocator associated with the container /// returns the allocator associated with the container
inline static allocator_type get_allocator() inline static allocator_type get_allocator()