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

Convert flatbuffers_version_string to inline function #7046

Merged
merged 3 commits into from
Jan 30, 2022

Conversation

dbaileychess
Copy link
Collaborator

Replaces #6707

@dbaileychess
Copy link
Collaborator Author

@aardappel

FLATBUFFERS_STRING(FLATBUFFERS_VERSION_REVISION);

#endif // !defined(_WIN32) && !defined(__CYGWIN__)
inline std::string flatbuffers_version_string() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much like the existing function, this can return a const char *.. you can concat static strings just by placing them next to eachother. std::string often implies an allocation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work when you are using FLATBUFFERS_VERSION() function return a const char *.

I guess I can just go back to concatenating all the versions numbers themselves.

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

Successfully merging this pull request may close these issues.

2 participants