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.
在 IDL 文件中,我有
struct CaseInfo { 1: CaseID = '', 2: EvID = 'foobar', } struct Case { 1: CaseInfo CaseInfo, 2: string key = '', }
创建 Case 对象的实例时,CaseInfo 只是 null;它不包含默认 CaseInfo 对象。设置此类对象的默认值的语法是什么?
看起来您可以通过字段名称到值的 json 样式映射来初始化结构的默认值。例如
struct Case{ 1: CaseInfo CaseInfo = {"CaseID": "", "EvID": "foobar"}, 2: string key = "" }