We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given a struct with a fixed sized array of scalar type
struct Somestruct { items: [float:3]; tag: uint8; }
flatc (with the --gen-compare flag) will generate c++ code that includes something like this:
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Somestruct FLATBUFFERS_FINAL_CLASS { private: float items_[3]; uint8_t tag_; int8_t padding0__; int16_t padding1__; public: const flatbuffers::Array<float, 3> *items() const { return &flatbuffers::CastToArray(items_); } inline bool operator==(const Somestruct &lhs, const Somestruct &rhs) { return (lhs.items() == rhs.items()) && (lhs.tag() == rhs.tag()); } }
Since items() returns the pointer of Array, this is only comparing the address but not the dereferenced value.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Given a struct with a fixed sized array of scalar type
flatc (with the --gen-compare flag) will generate c++ code that includes something like this:
Since items() returns the pointer of Array, this is only comparing the address but not the dereferenced value.
The text was updated successfully, but these errors were encountered: