[
https://issues.apache.org/jira/browse/THRIFT-2061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14142708#comment-14142708
]
Konrad Grochowski commented on THRIFT-2061:
-------------------------------------------
linked "implementation issue"
> 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 was sent by Atlassian JIRA
(v6.3.4#6332)