google / google/flatbuffers

No clear way to iterate over a fixed length array using reflection.h

Open
#8,938 2 comments 0 reactions 0 assignees View on GitHub
c++ question stale
Dominant language
C++
Stars
26.5k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

I cannot find any examples in the code base that use reflection.h with the Array type.
Here is an example .fbs (generated as a .bfbs)

````
struct Bar {
voltage:[float:5];
}

table Foo {
bars:Bar;
}

root_type Foo;

````

When using reflection and you encounter `field->type()->base_type() == reflection::Array`, how are you meant to extract the array field's values? Treating it as a vector causes a crash because the array size is 0.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.