Skip to content

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
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 <mikudehuane@gmail.com>
Co-authored-by: Derek Bailey <derekbailey@google.com>
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 <mikudehuane@gmail.com>
Co-authored-by: Derek Bailey <derekbailey@google.com>
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