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

Use boost::optional instead of bitfields

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • C++ - Compiler
    • None

    Description

      Switching to boost::optional instead of bitfields will give us some advantages. Here is the reasoning:

      • no more ambiguity on when to call .__set_XXX vs setting the field directly.
      • removes a bunch of code & makes it cleaner to us: no more obj.__isset.field, but instead obj.field.
      • makes it more compatible when dealing with Java & C+: code written in Java cannot be ported to C+ mechanically; requires thought to ensure you're using the thrift object in the semantics appropriate for the language.
      • makes it better than Java: numbers are handled as consistently as objects
      • boost::optional is on-track for C++14; will be easy to have code generate std::optional via a switch.
      • boost::optional is header-only & generated thrift code already depends on boost headers

      Challenges:

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vlovich Vitali Lovich
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: