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

Fix operator== for flatbuffers::optional #8223

Merged
merged 2 commits into from
May 29, 2024

Conversation

mikudehuane
Copy link
Contributor

flatbuffers::Optional behaves different from std::optional when both lhs and rhs are nullopt

flatbuffers::Optional<int> lhs = flatbuffers::nullopt;
flatbuffers::Optional<int> rhs = flatbuffers::nullopt;
std::cout << (lhs == rhs) << std::endl;  // false

std::optional<int> lhs = std::nullopt;
std::optional<int> rhs = std::nullopt;
std::cout << (lhs == rhs) << std::endl;  // true

This pull request simply modifies operator==

Copy link

google-cla bot commented Jan 23, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added the c++ label Jan 23, 2024
@dbaileychess dbaileychess enabled auto-merge (squash) May 29, 2024 02:35
@dbaileychess dbaileychess merged commit 0f8b711 into google:master May 29, 2024
45 checks passed
jochenparm pushed a commit to jochenparm/flatbuffers that referenced this pull request Oct 29, 2024
…l when lhs and rhs are both nullopt (google#8223)

Co-authored-by: islander <[email protected]>
Co-authored-by: Derek Bailey <[email protected]>
jochenparm pushed a commit to jochenparm/flatbuffers that referenced this pull request Oct 29, 2024
…l when lhs and rhs are both nullopt (google#8223)

Co-authored-by: islander <[email protected]>
Co-authored-by: Derek Bailey <[email protected]>
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