mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-24 07:11:49 +00:00
[C++] Add Builder and Table typedefs (#5685)
* Add Builder and Table typedefs This gives us a way to use templates to go from a builder to a table and back again without having to pass both types in. * Fix tests/cpp17/generated_cpp17/monster_test_generated.h
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
31f8799083
commit
901b89e733
@@ -10,6 +10,7 @@ namespace NamespaceA {
|
||||
namespace NamespaceB {
|
||||
|
||||
struct TableInNestedNS;
|
||||
struct TableInNestedNSBuilder;
|
||||
struct TableInNestedNST;
|
||||
|
||||
struct StructInNestedNS;
|
||||
@@ -118,6 +119,7 @@ inline bool operator!=(const TableInNestedNST &lhs, const TableInNestedNST &rhs)
|
||||
|
||||
struct TableInNestedNS FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
typedef TableInNestedNST NativeTableType;
|
||||
typedef TableInNestedNSBuilder Builder;
|
||||
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
|
||||
return TableInNestedNSTypeTable();
|
||||
}
|
||||
@@ -141,6 +143,7 @@ struct TableInNestedNS FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
};
|
||||
|
||||
struct TableInNestedNSBuilder {
|
||||
typedef TableInNestedNS Table;
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_foo(int32_t foo) {
|
||||
|
||||
Reference in New Issue
Block a user