thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Reynolds <...@stureynolds.com>
Subject Self referential classes
Date Mon, 26 Jan 2015 15:05:21 GMT
Looking at the archives:
http://mail-archives.apache.org/mod_mbox/thrift-user/201011.mbox/%3CAANLkTi=JFbUR1W94dpw3ZPXH=LhE_AVcNDRc_DK=UG_=@mail.gmail.com%3E

I understand that the following causes problems for C++:

struct A {
  1: A a;
}

because sizeof(A)==infinity.


1-- the above .thrift compiles for in thrift 0.9.2. Are there guards
against it in later versions of thrift? If so, can there any
configuration possible surround this? (for example, ignoring the error
because C++ it not a target, or changing the C++ output to use aptr
for field members).

2 -- Are self referencing collections generally allowed? (Can't test
locally -- for now stuck with 0.9.2) e.g. :

struct A {
  1: list<A> children;
}


Thanks,
- Stuart

Mime
View raw message