You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Doug Judd (JIRA)" <ji...@apache.org> on 2014/05/16 23:38:15 UTC

[jira] [Commented] (THRIFT-2526) Assignment operators and copy constructors in c++ don't copy the __isset struct

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

Doug Judd commented on THRIFT-2526:
-----------------------------------

The attached patch thrift-2526.patch fixes this for me.

> Assignment operators and copy constructors in c++ don't copy the __isset struct
> -------------------------------------------------------------------------------
>
>                 Key: THRIFT-2526
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2526
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Compiler
>    Affects Versions: 0.9.2
>            Reporter: Dirk Vanden Boer
>            Priority: Trivial
>         Attachments: thrift-2526.patch
>
>
> I have a thrift protocol that returns a list of items. The items have optional fields. Putting these items in a vector the optional fields are not sent to clients as the assignment operator does not copy the __isset struct.
> Generated code:
> Item::Item(const Item& other3) {
>   id = other3.id;
>   title = other3.title;
>   itemclass = other3.itemclass;
>   thumbnailurl = other3.thumbnailurl;
> }
> Adding __isset = other3.__isset; fixes this issue.
> Same for the assignment operator.



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