Skip to content

Commit

Permalink
Change all GenericMemberIterator from struct to class
Browse files Browse the repository at this point in the history
  • Loading branch information
miloyip committed Jun 28, 2019
1 parent 4b3d7c2 commit d87b698
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/rapidjson/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,17 @@ class GenericMemberIterator {
// class-based member iterator implementation disabled, use plain pointers

template <bool Const, typename Encoding, typename Allocator>
struct GenericMemberIterator;
class GenericMemberIterator;

//! non-const GenericMemberIterator
template <typename Encoding, typename Allocator>
struct GenericMemberIterator<false,Encoding,Allocator> {
class GenericMemberIterator<false,Encoding,Allocator> {
//! use plain pointer as iterator type
typedef GenericMember<Encoding,Allocator>* Iterator;
};
//! const GenericMemberIterator
template <typename Encoding, typename Allocator>
struct GenericMemberIterator<true,Encoding,Allocator> {
class GenericMemberIterator<true,Encoding,Allocator> {
//! use plain const pointer as iterator type
typedef const GenericMember<Encoding,Allocator>* Iterator;
};
Expand Down

1 comment on commit d87b698

@ericrannaud
Copy link
Contributor

@ericrannaud ericrannaud commented on d87b698 Sep 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces a bug: it makes GenericMemberIterator::Iterator private in these two classes. You should add a "public:" declaration.

build/linux_x64/include/rapidjson/document.h:586:71: error: 'Iterator' is a private member of
      'rapidjson::GenericMemberIterator<false, rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >'
    typedef typename GenericMemberIterator<false,Encoding,Allocator>::Iterator MemberIterator;  //!< Member iterator for i...
                                                                      ^
build/linux_x64/include/rapidjson/document.h:2124:32: note: in instantiation of template class
      'rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >' requested here
class GenericDocument : public GenericValue<Encoding, Allocator> {

Please see #1568

Please sign in to comment.