summaryrefslogtreecommitdiff
path: root/rapidjson
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2022-03-15 15:33:39 -0400
committerRusty Wagner <rusty.wagner@gmail.com>2022-03-15 15:33:39 -0400
commit822b20b06529e2439fe296c5fe1ef277436c5c0b (patch)
tree755d9918ed2eace44299acd43968c0a3d36c51c7 /rapidjson
parent9f09f682617f5501457a7f34bde0b26667b96d14 (diff)
Fix usage of deprecated std::iterator in rapidjson
Diffstat (limited to 'rapidjson')
-rw-r--r--rapidjson/document.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/rapidjson/document.h b/rapidjson/document.h
index f873c272..fcb2d663 100644
--- a/rapidjson/document.h
+++ b/rapidjson/document.h
@@ -99,17 +99,20 @@ struct GenericMember {
*/
template <bool Const, typename Encoding, typename Allocator>
class GenericMemberIterator
- : public std::iterator<std::random_access_iterator_tag
- , typename internal::MaybeAddConst<Const,GenericMember<Encoding,Allocator> >::Type> {
-
+{
friend class GenericValue<Encoding,Allocator>;
template <bool, typename, typename> friend class GenericMemberIterator;
typedef GenericMember<Encoding,Allocator> PlainType;
typedef typename internal::MaybeAddConst<Const,PlainType>::Type ValueType;
- typedef std::iterator<std::random_access_iterator_tag,ValueType> BaseType;
public:
+ using iterator_category = std::random_access_iterator_tag;
+ using value_type = typename internal::MaybeAddConst<Const, GenericMember<Encoding, Allocator>>::Type;
+ using difference_type = ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type&;
+
//! Iterator type itself
typedef GenericMemberIterator Iterator;
//! Constant iterator type
@@ -118,11 +121,11 @@ public:
typedef GenericMemberIterator<false,Encoding,Allocator> NonConstIterator;
//! Pointer to (const) GenericMember
- typedef typename BaseType::pointer Pointer;
+ typedef pointer Pointer;
//! Reference to (const) GenericMember
- typedef typename BaseType::reference Reference;
+ typedef reference Reference;
//! Signed integer type (e.g. \c ptrdiff_t)
- typedef typename BaseType::difference_type DifferenceType;
+ typedef difference_type DifferenceType;
//! Default constructor (singular value)
/*! Creates an iterator pointing to no element.