使用 FlatBuffer 全反射
相關代碼
const reflection::Schema& schema = *reflection::GetSchema( binary_fbs_file.c_str() );
auto root_table = schema.root_table();
auto fields = root_table->fields();
for (size_t = 0; i < fields->size(); i )
{
auto field = fields->Get( i );
// 14 is the enum number for vector.
if ( field->type()->base_type() == 14 )
{
// How do I check the type of the vector here?
}
}
代碼中的相關問題,但我如何檢查向量的型別是什么?它是 int32、double、string 嗎?
uj5u.com熱心網友回復:
field->type()->element()是向量內容的型別。
有關. _ _element
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/431232.html
上一篇:C 自動decltype模板
