You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are special rules around rewritten operator candidates that make the following example well-formed, because the example appears in existing code bases:
struct B {
bool operator==(const B&);
};
struct C : B {
C();
C(B);
bool operator!=(const B&);
};
bool c1 = B() == C(); // should be OK
Due to unrelated changes, the current wording makes this example ill-formed (because the two member operators have different object parameter types). This was not intended.
While fixing this, should the special rules be extended to also cover member operators with explicit object parameters? It seems unlikely that a new feature such as explicit object parameters would appear in a code base that also uses rather baroque combinations of comparison operators.
jfbastien
changed the title
CWG2797: Meaning of "corresponds" for rewritten operator candidates
CWG2797 Meaning of "corresponds" for rewritten operator candidates
Oct 16, 2023
There are special rules around rewritten operator candidates that make the following example well-formed, because the example appears in existing code bases:
Due to unrelated changes, the current wording makes this example ill-formed (because the two member operators have different object parameter types). This was not intended.
While fixing this, should the special rules be extended to also cover member operators with explicit object parameters? It seems unlikely that a new feature such as explicit object parameters would appear in a code base that also uses rather baroque combinations of comparison operators.
See CWG2797 for more details.
The text was updated successfully, but these errors were encountered: