Pretty sure it's "1" for true, "0" for false. Ugly, I know. I'd be open to
applying a patch to fix this, if you wanted to submit one. I'd appreciate a
ticket in any case.

On Tue, Apr 5, 2011 at 2:00 PM, Nevo Hed <[email protected]> wrote:

> Hi Folks
>
> What the correct way to specify a default value for an optional boolean?
>
> I tried 'true' and 'false' but got errors:
>
> struct AtscStrmRecordRequestT {
>    1: optional bool bDoSomething = true,
>    2: required string whatever;
> }
>
>
> $ /opt/thrift-0.6.0/compiler/cpp/thrift --gen cpp /rtmp/x.thrift
> [ERROR:/rtmp/x.thrift:2] (last token was 'true')
> Cannot use reserved language keyword: "true"
>
>
> Thanks!
>   -Nevo
>

Reply via email to