mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-19 21:05:43 +00:00
[C++] Add Vector64 specialization for std::vector<bool> (#8757)
* add vector64 specialization for vector<bool> * fix generated code --------- Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
This commit is contained in:
@@ -18,6 +18,10 @@ table RootTable {
|
||||
// A normal 32-bit sized string, that could be very far away (64-bit address).
|
||||
far_string:string (offset64);
|
||||
|
||||
// a big vector of bool, that could be very far away (64-bit address).
|
||||
// tests vector<bool> specialization with 64-bit offsets.
|
||||
big_bool_vector:[ubyte] (vector64);
|
||||
|
||||
// A big 64-bit sized vector, that could be very far away (64-bit address).
|
||||
big_vector:[ubyte] (vector64);
|
||||
|
||||
@@ -27,19 +31,19 @@ table RootTable {
|
||||
// A big 64-bit sized vector that is a nested flatbuffers (64-bit address).
|
||||
nested_root:[ubyte] (vector64, nested_flatbuffer: "RootTable");
|
||||
|
||||
// A normal 32-bit size vector of structs, that could be very far away
|
||||
// A normal 32-bit size vector of structs, that could be very far away
|
||||
// (64-bit address)
|
||||
far_struct_vector:[LeafStruct] (offset64);
|
||||
|
||||
// A big 64-bit size vector of structs that could be very far away
|
||||
// A big 64-bit size vector of structs that could be very far away
|
||||
// (64-bit address)
|
||||
big_struct_vector:[LeafStruct] (vector64);
|
||||
|
||||
// A normal 32-bit size vector of tables. Currently 64-bit vectors don't
|
||||
// A normal 32-bit size vector of tables. Currently 64-bit vectors don't
|
||||
// support tables as it would require serializing a table (32-bit) before the
|
||||
// vector (64-bit), which is not allowed.
|
||||
//
|
||||
// This demonstrates how you could have many vectors in the buffer, by
|
||||
// This demonstrates how you could have many vectors in the buffer, by
|
||||
// effectively having a vector of 64-bit vectors. The IDL doesn't support
|
||||
// nested vecotrs (e.g.: [[type]] ), so going through a wrapper table allows
|
||||
// this.
|
||||
@@ -50,4 +54,4 @@ table RootTable {
|
||||
forced_aligned_vector:[ubyte] (vector64, force_align:32);
|
||||
}
|
||||
|
||||
root_type RootTable;
|
||||
root_type RootTable;
|
||||
|
||||
Reference in New Issue
Block a user