@@ -45,7 +45,7 @@ RAPIDJSON_DIAG_OFF(terminate) // ignore throwing RAPIDJSON_ASSERT in RAPIDJSON_N
45
45
#endif // __GNUC__
46
46
47
47
#ifndef RAPIDJSON_NOMEMBERITERATORCLASS
48
- #include < iterator> // std::iterator, std:: random_access_iterator_tag
48
+ #include < iterator> // std::random_access_iterator_tag
49
49
#endif
50
50
51
51
#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
@@ -98,16 +98,13 @@ struct GenericMember {
98
98
\see GenericMember, GenericValue::MemberIterator, GenericValue::ConstMemberIterator
99
99
*/
100
100
template <bool Const, typename Encoding, typename Allocator>
101
- class GenericMemberIterator
102
- : public std::iterator<std::random_access_iterator_tag
103
- , typename internal::MaybeAddConst<Const,GenericMember<Encoding,Allocator> >::Type> {
101
+ class GenericMemberIterator {
104
102
105
103
friend class GenericValue <Encoding,Allocator>;
106
104
template <bool , typename , typename > friend class GenericMemberIterator ;
107
105
108
106
typedef GenericMember<Encoding,Allocator> PlainType;
109
107
typedef typename internal::MaybeAddConst<Const,PlainType>::Type ValueType;
110
- typedef std::iterator<std::random_access_iterator_tag,ValueType> BaseType;
111
108
112
109
public:
113
110
// ! Iterator type itself
@@ -117,12 +114,21 @@ class GenericMemberIterator
117
114
// ! Non-constant iterator type
118
115
typedef GenericMemberIterator<false ,Encoding,Allocator> NonConstIterator;
119
116
117
+ /* * \name std::iterator_traits support */
118
+ // @{
119
+ typedef ValueType value_type;
120
+ typedef ValueType * pointer;
121
+ typedef ValueType & reference;
122
+ typedef std::ptrdiff_t difference_type;
123
+ typedef std::random_access_iterator_tag iterator_category;
124
+ // @}
125
+
120
126
// ! Pointer to (const) GenericMember
121
- typedef typename BaseType:: pointer Pointer;
127
+ typedef pointer Pointer;
122
128
// ! Reference to (const) GenericMember
123
- typedef typename BaseType:: reference Reference;
129
+ typedef reference Reference;
124
130
// ! Signed integer type (e.g. \c ptrdiff_t)
125
- typedef typename BaseType:: difference_type DifferenceType;
131
+ typedef difference_type DifferenceType;
126
132
127
133
// ! Default constructor (singular value)
128
134
/* ! Creates an iterator pointing to no element.
0 commit comments