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

Make absl::from_chars_result compatible with C++20 and C++26 #1800

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MBkkt
Copy link
Contributor

@MBkkt MBkkt commented Dec 29, 2024

@MBkkt MBkkt changed the title Make compatible with C++20 and C++26 Make absl::from_chars_result compatible with C++20 and C++26 Dec 29, 2024
@@ -47,6 +47,10 @@ enum class chars_format {
struct from_chars_result {
absl::Nonnull<const char*> ptr;
std::errc ec;

bool operator==(const from_chars_result&) = default;
Copy link
Member

Choose a reason for hiding this comment

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

This change doesn't work prior to C++20. You will have to implement the operator method.

/abseil-cpp/absl/strings/charconv.h:51:8: error: defaulted 'bool absl::from_chars_result::operator==(const absl::from_chars_result&)' only available with '-std=c++20' or '-std=gnu++20'
   51 |   bool operator==(const from_chars_result&) = default;

Also, I know this is a simple change, but it still needs test coverage.

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

Successfully merging this pull request may close these issues.

3 participants