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
[expr.rel] Unclear how function pointers are compared #3850
Comments
We don't allow relational comparisons of pointers to members. |
In which way is that "not clean"? There are a few more situations where comparing pointers is unspecified, and comparing function pointers is just one special case. Apparently, the right result falls out from the rules, so we're good. |
@jensmaurer The pointer to object case is reasonable - we define right above here what it means to compare those, and specifies a clear partial ordering. For the pointer to function case, we never even talk about what greater means. So I have to understand that I have to skip over the "Otherwise, if a pointer p compares greater than a pointer q" by way of p can't compare greater than a because we never say what that means. It's like solving a logic puzzle to figure out what the rules are... |
Editorial meeting: Call out pointers to functions explicitly (as unspecified). |
The intent of the wording is that result of
p < q
for unequal function pointers is unspecified - but the way we get there is that [expr.rel]/4 defines when pointers to objects compare greater and then [expr.rel]/5 we fall through to "Otherwise, the result of each of the operators is unspecified."Can we clean this up by inserting a new paragraph between [expr.rel]/4 and [expr.rel]/5 as follows:
Or something?
The text was updated successfully, but these errors were encountered: