mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
dodgy example code
This commit is contained in:
parent
0785e0b415
commit
2a9d0a43b8
|
@ -7099,7 +7099,7 @@ Avoiding inconsistent definition in different namespaces
|
||||||
bool operator==(S, S); // OK: in the same namespace as S, and even next to S
|
bool operator==(S, S); // OK: in the same namespace as S, and even next to S
|
||||||
S s;
|
S s;
|
||||||
|
|
||||||
bool s == s;
|
bool x = (s == s);
|
||||||
|
|
||||||
This is what a default `==` would do, if we had such defaults.
|
This is what a default `==` would do, if we had such defaults.
|
||||||
|
|
||||||
|
@ -7112,7 +7112,7 @@ This is what a default `==` would do, if we had such defaults.
|
||||||
|
|
||||||
N::S s;
|
N::S s;
|
||||||
|
|
||||||
bool s == s; // finds N::operator==() by ADL
|
bool x = (s == s); // finds N::operator==() by ADL
|
||||||
|
|
||||||
##### Example, bad
|
##### Example, bad
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user