Skip to content

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

@jemeador

Description

@jemeador

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions