khoarus / rapidjson

Automatically exported from code.google.com/p/rapidjson
MIT License
0 stars 0 forks source link

complie error in aix, The referenced type "rapidjson::GenericValue" contains a circular reference back to "Member" #64

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.when i complie rapidjson in AIX(6.0) with xlC
xlC -qversion
IBM XL C/C++ for AIX, V11.1 (5724-X13)
Version: 11.01.0000.0005

It seems that the c++ template is no supported well in aix.
how can i fix it?

Original issue reported on code.google.com by kingcjj...@gmail.com on 10 Apr 2013 at 7:20

GoogleCodeExporter commented 8 years ago
i have the same problem ,now this problem have resolve or not ?

Original comment by linda080...@gmail.com on 15 Apr 2013 at 7:44

GoogleCodeExporter commented 8 years ago
i have the same problem ,now this problem have resolve or not ?

Original comment by linda080...@gmail.com on 15 Apr 2013 at 7:44

GoogleCodeExporter commented 8 years ago
Thansk to my colleague,we fix it. we change the declare of GenericValue and 
GenericValue.member in "document.h"

//document.h
namespace rapidjson {

///////////////////////////////////////////////////////////////////////////////
// GenericValue

//! Represents a JSON value. Use Value for UTF8 encoding and default allocator.
/*!
    A JSON value can be one of 7 types. This class is a variant type supporting
    these types.

    Use the Value if UTF8 and default allocator

    \tparam Encoding    Encoding of the value. (Even non-string values need to have the same encoding in a document)
    \tparam Allocator   Allocator type for allocating memory of object, array and string.
*/
#ifdef OS_SUN
#pragma pack (4)
#else
#pragma pack (push, 4)
#endif
template <typename Encoding, typename Allocator > 
class GenericValue;

template <typename Encoding, typename Allocator > 
    class _Member { 
    public:
        GenericValue<Encoding, Allocator> name;     //!< name of member (must be a string)
        GenericValue<Encoding, Allocator> value;    //!< value of member.
    } ;

template <typename Encoding, typename Allocator = MemoryPoolAllocator<> > 
class GenericValue {
public:
    //! Name-value pair in an object.
       typedef _Member<Encoding, Allocator> Member;
    typedef Encoding EncodingType;                  //!< Encoding type from template parameter.
    typedef Allocator AllocatorType;                //!< Allocator type from template parameter.
    typedef typename Encoding::Ch Ch;               //!< Character type derived from Encoding.
    typedef Member* MemberIterator;                 //!< Member iterator for iterating in object.
    typedef const Member* ConstMemberIterator;      //!< Constant member iterator for iterating in object.
    typedef GenericValue* ValueIterator;            //!< Value iterator for iterating in array.
    typedef const GenericValue* ConstValueIterator; //!< Constant value iterator for iterating in array.

///the rest is the same.....

Original comment by kingcjj...@gmail.com on 21 Apr 2013 at 3:03

Attachments:

GoogleCodeExporter commented 8 years ago
we fix it. we change the declare of GenericValue and
GenericValue.member in "document.h"

//document.h
namespace rapidjson {

///////////////////////////////////////////////////////////////////////////////
// GenericValue

//! Represents a JSON value. Use Value for UTF8 encoding and default allocator.
/*!
    A JSON value can be one of 7 types. This class is a variant type supporting
    these types.

    Use the Value if UTF8 and default allocator

    \tparam Encoding    Encoding of the value. (Even non-string values need
to have the same encoding in a document)
    \tparam Allocator   Allocator type for allocating memory of object,
array and string.
*/
#ifdef OS_SUN
#pragma pack (4)
#else
#pragma pack (push, 4)
#endiftemplate <typename Encoding, typename Allocator >
class GenericValue;

template <typename Encoding, typename Allocator >
    class _Member {
    public:
        GenericValue<Encoding, Allocator> name;     //!< name of member (must
be a string)
        GenericValue<Encoding, Allocator> value;    //!< value of member.
    } ;

template <typename Encoding, typename Allocator = MemoryPoolAllocator<> >
class GenericValue {
public:
    //! Name-value pair in an object.
       typedef _Member<Encoding, Allocator> Member;
    typedef Encoding EncodingType;                  //!< Encoding type from template parameter.
    typedef Allocator AllocatorType;                //!< Allocator type from template
parameter.
    typedef typename Encoding::Ch Ch;               //!< Character type derived from Encoding.
    typedef Member* MemberIterator;                 //!< Member iterator for
iterating in object.
    typedef const Member* ConstMemberIterator;      //!< Constant member
iterator for iterating in object.
    typedef GenericValue* ValueIterator;            //!< Value iterator for
iterating in array.
    typedef const GenericValue* ConstValueIterator; //!< Constant value
iterator for iterating in array.

///the rest is the same.....

Original comment by kingcjj...@gmail.com on 21 Apr 2013 at 3:05

GoogleCodeExporter commented 8 years ago
any changes to have this fix applied in trunk?

Original comment by olex...@gmail.com on 7 Aug 2013 at 6:48

GoogleCodeExporter commented 8 years ago
Merged at https://github.com/miloyip/rapidjson/pull/33

_Member is named as GenericMember

I don't have the compiler mentioned. Please help verify. Thank you.

Original comment by milo...@gmail.com on 30 Jun 2014 at 11:14