mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-04 04:33:23 +00:00
[C++] Using calculated fields_number for field_names size (#6769)
* using already defined "fields_number" in "field_names" size calculation * tests * forgotten test
This commit is contained in:
@@ -639,7 +639,8 @@ struct ScalarStuff::Traits {
|
||||
static auto constexpr Create = CreateScalarStuff;
|
||||
static constexpr auto name = "ScalarStuff";
|
||||
static constexpr auto fully_qualified_name = "optional_scalars.ScalarStuff";
|
||||
static constexpr std::array<const char *, 36> field_names = {
|
||||
static constexpr size_t fields_number = 36;
|
||||
static constexpr std::array<const char *, fields_number> field_names = {
|
||||
"just_i8",
|
||||
"maybe_i8",
|
||||
"default_i8",
|
||||
@@ -679,7 +680,6 @@ struct ScalarStuff::Traits {
|
||||
};
|
||||
template<size_t Index>
|
||||
using FieldType = decltype(std::declval<type>().get_field<Index>());
|
||||
static constexpr size_t fields_number = 36;
|
||||
};
|
||||
|
||||
flatbuffers::Offset<ScalarStuff> CreateScalarStuff(flatbuffers::FlatBufferBuilder &_fbb, const ScalarStuffT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
|
||||
|
||||
Reference in New Issue
Block a user