-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
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
Core: Support c++20 compilation #89660
base: master
Are you sure you want to change the base?
Conversation
917f79d
to
2537226
Compare
@@ -835,17 +835,6 @@ bool Variant::operator==(const Variant &p_variant) const { | |||
return hash_compare(p_variant); | |||
} | |||
|
|||
bool Variant::operator!=(const Variant &p_variant) const { | |||
// Don't use `!hash_compare(p_variant)` given it makes use of OP_EQUAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This note matters, so I don't think this is a valid change, is not having an explicit !=
operator required for C++20? If so that's a problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a requirement, no; if need be, this can be the exception to the implicit conversion. With that said, all the existing tests pass, and I don't think there's any Variant operation where x != y
and !(x == y)
produce different values. Still worth looking into for verification, but I'm skeptical of how much weight this note has.
2537226
to
57d8729
Compare
2b315bd
to
eea4fcd
Compare
655a1da
to
4e4d1f5
Compare
f3044b6
to
1b1499a
Compare
1b1499a
to
23a59f4
Compare
• Technically c++23 as well, albeit to a *much* lesser extent because it's not officially released
23a59f4
to
9ba6de0
Compare
Adds a new
cpp_standard
experimental variable to SCons, to allow the user to choose which C++ standard to compile with. The choices are "17" and "20", defaulting to 17. In addition, this makes changes across the repo to allow compilation of c++20 to be possible in the first place, which primarily comes down to more operators to prevent ambiguous conversions. Currently, a c++20 build successfully compiles (withwerror=no
).Submitted as a draft, as while the equality operators are accounted for, there's still the ordering operators. Inequality operators could be handled with a wrapper, but ordering operators will be a bit more involved than that; ideally the
<=>
operator will be used, so long as parity with the secondary operators is kept between 17 & 20. There's also the matter of making sure the other warnings are accounted for, which are largely secondary but still important so long as they don't negatively impact c++17 (which will remain the repo "default").EDIT: Added "support" for c++23 as well, albeit to a much lesser extent because its currently experimental.