Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
c2hs 参考(又名“教程”)提到了 C 枚举的名称作为非可选参数。有没有办法让它与匿名枚举一起工作?仅给定一个枚举成员就可以确定要生成的枚举,或者即使不可能,至少应该可以通过显式命名枚举成员来生成枚举。
澄清:
给定一个枚举
enum { A, B, C, D };
我想要一些类似的东西
{#enum {A,B,C,D} as MyEnum #}
枚举定义工作(与文档相反)
{# enum define MyEnum { A as A, B as B, C as C, D as D } #}