Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2526

Assignment operators and copy constructors in c++ don't copy the __isset struct

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 0.9.2
    • 0.9.2
    • C++ - Compiler
    • None

    Description

      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.

      Attachments

        1. thrift-2526.patch
          2 kB
          Doug Judd

        Issue Links

          Activity

            People

              roger Roger Meier
              dirk.vdb Dirk Vanden Boer
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: