如何在节俭中跨命名空间访问变量

How to access variables across namespaces in thrift

本文关键字:命名空间 访问 变量      更新时间:2023-10-16

假设我有两个文件

节俭的东西

namespace cpp something
struct Something { ... }

了不起,节俭

include "Something.thrift"
namespace cpp marvelous
struct IncludingSomething {
    1: required something::Something;
}

这里无法识别范围解析运算符,如何从Marvelous.thrift访问Something

使用 dot 运算符。 所以像这样

include "Something.thrift"
namespace cpp marvelous
struct IncludingSomething {
    1: required something.Something;
}