[ 
https://issues.apache.org/jira/browse/THRIFT-2473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13974016#comment-13974016
 ] 

Nevo Hed commented on THRIFT-2473:
----------------------------------

So what is preventing you from adding the keyword "required"?
I know I have seen something somewhere that says that the default requiredness 
is "required" but I think in practice it is a third type (T_OPT_IN_REQ_OUT).  I 
don't know why this is but I suspect that it is done for compatibility with 
original behavior.  But probably best practice should be to always specify 
requiredness, especially for your desired behavior.

{code}
  enum e_req {
    T_REQUIRED,
    T_OPTIONAL,
    T_OPT_IN_REQ_OUT  <<<<===
  };
{code}


> _isset entries shouldn't be generated for non-optional fields
> -------------------------------------------------------------
>
>                 Key: THRIFT-2473
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2473
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Compiler
>            Reporter: Vitali Lovich
>
> There's quite a bit of memory overhead (4 bytes per field) that's wasted on 
> every single type.  The __isset field is unused by the thrift type for fields 
> not annotated optional.
> Additionally, it causes confusion in program code since people never know 
> whether or not the __isset struct can be checked for a particular field or 
> not (e.g. for non-optional fields it would never get set normally unless you 
> deserialized it).



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to