Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
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
- relates to
-
THRIFT-2717 C++V2 generator/library
- Open