mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 20:54:41 +03:00
dodgy example code
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user