[
https://issues.apache.org/jira/browse/THRIFT-2429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13976322#comment-13976322
]
Aleksey Pesternikov commented on THRIFT-2429:
---------------------------------------------
{quote}
Another thing that comes to mind is that of the two, =? allows you to do this:
{code}
service someService {
void func( 1: string myName =? "thrift" )
}
{code}
{quote}
functional equivalent for #2 would be
{code}
service someService {
void func( 1: optional string myName = "thrift" )
}
{code}
However compiler warns that "optional keyword is ignored in argument lists.". I
wander why, and whether the reason apply to {{1: string myName =? "thrift"}}
considering it is semantically optional...
> Provide option to not write default values, rely on receiver default
> construction instead
> -----------------------------------------------------------------------------------------
>
> Key: THRIFT-2429
> URL: https://issues.apache.org/jira/browse/THRIFT-2429
> Project: Thrift
> Issue Type: Improvement
> Components: C++ - Compiler
> Affects Versions: 0.9.1
> Reporter: Chris Stylianou
> Assignee: Randy Abernethy
> Labels: default, optional, required
>
> Would there be any objections to a patch that does not write default values
> (essentially the same logic as the optional attributes). This obviously
> relies on the receiving application using the same IDL version to ensure the
> defaults used on object construction match the senders.
--
This message was sent by Atlassian JIRA
(v6.2#6252)