Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeTables derive from an empty base class, for no clear reason [C++] #8406

Open
DaveBrantonCTCT opened this issue Sep 27, 2024 · 0 comments

Comments

@DaveBrantonCTCT
Copy link

All the generated T suffix Native Table types for the C++ Object API derive from flatbuffers::NativeTable. There is no use-case for this that I can discern in the generated code, and the comment next to this empty class states

// Contains no functionality, purely documentative.
struct NativeTable {};

The existence of this base class means that the native table types cannot be brace-initialised without adding an additional {} at the start of the brace-initialiser list - and even that's only true since C++17.

Perhaps this empty base class could be removed, as it contains no functionality and hinders some use-cases? Since no constructor is provided for the NativeTable types, brace-initialisation is the only inline construction option for these classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant