[ 
https://issues.apache.org/jira/browse/THRIFT-2471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13975996#comment-13975996
 ] 

Henrique Mendonça commented on THRIFT-2471:
-------------------------------------------

+1 for changing the cpp.ref to simply "*" (or perhaps "&")
However, I don't think you should take ownership of the pointers, this is 
confusing and unclear. I didn't realise it from the original patch, but I 
strongly believe we need to change this before release. The user should handle 
the pointer himself or use plain objects if he/she wants automatic memory 
management. I don't see the point of having references otherwise as no 
associations are allowed. In this case the reference symbol "&" will probably 
be more clear, and the implementation could also follow. Thoughts?

[~codesf] I always wished for a shared_ptr implementation but I think we'd need 
to change everything to shared_ptr and the "*&cpp.ref" to weak_ptr. It would 
work on both boost and c++11. In this case "_isset" wouldn't be necessary any 
longer ;)

> Make cpp.ref annotation language agnostic
> -----------------------------------------
>
>                 Key: THRIFT-2471
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2471
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (General)
>            Reporter: Jens Geyer
>             Fix For: 0.9.2
>
>
> The proposal is to make the new {{cpp.ref}} annotation introduced with 
> THRIFT-2421 language agnostic instead of a C++ specialty only. 
> The annotation changes inlined nested structs into pointers to structs. This 
> behaviour is potentially relevant with all languages using value semantics 
> for nested structs etc.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to