mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-01 03:51:37 +00:00
Add support for using array of scalar as key field in Cpp (#7623)
* add support for using array of scalar as key field * update cmakelist and test.cpp to include the tests * update bazel rule * address comments * clang format * delete comment * delete comment * address the rest of the commnets * address comments * update naming in test file * format build file * buildifier * make keycomparelessthan call keycomparewithvalue * update to use flatbuffer array instead of raw pointer * clang * format * revert format * revert format * update * run generate_code.py * run code generator * revert changes by generate_code.py * fist run make flatc and then run generate_code.py Co-authored-by: Wen Sun <sunwen@google.com>
This commit is contained in:
21
tests/key_field/key_field_sample.fbs
Normal file
21
tests/key_field/key_field_sample.fbs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace keyfield.sample;
|
||||
|
||||
struct Baz {
|
||||
a: [uint8:4] (key); // A fixed-sized array of uint8 as a Key
|
||||
b: uint8 ;
|
||||
}
|
||||
|
||||
struct Bar {
|
||||
a: [float:3] (key); // A fixed-sized array of float as a Key
|
||||
b: uint8;
|
||||
}
|
||||
|
||||
table FooTable {
|
||||
a: int;
|
||||
b: int;
|
||||
c: string (key);
|
||||
d: [Baz];
|
||||
e: [Bar];
|
||||
}
|
||||
root_type FooTable;
|
||||
|
||||
Reference in New Issue
Block a user