Is it possible to mutate array of tables when using C++ (not object) API without recreating entire flatbuffer?
Here is an example of my schema
table Document {
root_layer:Layer;
bitmaps:[Bitmap];
subdocuments:[Document];
}
table Layer {
id:int;
sublayers:[Layer];
}
...
Interesting here part is document → root_layer → sublayers
Let's say I want to modify entire sublayers array: re-write it completely, not just to replace element at index. Mutability API as far as I saw only allows to replace element at index, not to replace entire array with a new array, right?
Today I end up recreating entire document copying all the fields from the original one and once I get to the nested sublayers
I replace it with new array
Is there a better way of doing it?