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

should c++ have setters for optional fields?

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.7
    • C++ - Compiler
    • None
    • c++

    Description

      It seems non-intuitive to me to have to set __isset.someField = true after setting an optional field someField on a struct. Would it make sense to have a set_someField method that would both set the field and modify __isset?

      One of the cases for this is for when a field goes from being required to being optional, and it's easy to forget to set __isset in the code.

      Attachments

        1. thrift-627_0.5.x.patch
          2 kB
          JCF
        2. thrift-627_trunk.patch
          2 kB
          JCF
        3. thrift-627.patch
          2 kB
          JCF
        4. thrift-627.patch
          2 kB
          JCF
        5. thrift-627-no-cap-name.patch
          1 kB
          Eric Rannaud

        Activity

          People

            jfarrell Jake Farrell
            coshx Ben Taitelbaum
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: