Vitali Lovich created THRIFT-2061:
-------------------------------------
Summary: Use boost::optional instead of bitfields
Key: THRIFT-2061
URL: https://issues.apache.org/jira/browse/THRIFT-2061
Project: Thrift
Issue Type: Improvement
Components: C++ - Compiler
Reporter: Vitali Lovich
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:
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira