[
https://issues.apache.org/jira/browse/THRIFT-5843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17909522#comment-17909522
]
Triton Circonflexe commented on THRIFT-5843:
--------------------------------------------
Hello [~fishywang],
Jumping in just to answer your question: they are open enumerations (SAST tools
might signal incomplete handling and whatnot but compilers won’t bulge).
I think that’s a good idea to have the option as it is increasingly becoming
included in companies development guidelines.
> Represent Thrift enums as C++ enum classes
> ------------------------------------------
>
> Key: THRIFT-5843
> URL: https://issues.apache.org/jira/browse/THRIFT-5843
> Project: Thrift
> Issue Type: Improvement
> Components: C++ - Compiler
> Affects Versions: 0.21.0
> Reporter: Tim Crews
> Priority: Minor
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> Add a *cpp:enum_classes* option to the C++ compiler so that a Thrift enum
> declaration like this:
> {{enum PrintDirection}}
> {
> {{ Down = 68,}}
> {{ Up = 85}}
> {{}}}
> becomes a C++ [scoped
> enumeration|https://en.cppreference.com/w/cpp/language/enum#Scoped_enumerations]
> declaration like this:
> {{enum class PrintDirection {}}
> {{ Down = 68,}}
> {{ Up = 85}}
> {{};}}
> This is very similar to the existing *cpp::pure_enums* option, but it
> addresses the drawback that all of the enumerators (the values like Down and
> Up) are in the same namespace as the enumerators from other enum types.
> I already have a working implementation of this feature that I have been
> using on a private fork of Thrift for about five years, so the only work
> required would be to prepare the pull request.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)