mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 12:44:42 +03:00
Minor style issues
This commit is contained in:
@@ -4965,7 +4965,10 @@ It is really hard to write a foolproof and useful `==` for a hierarchy.
|
||||
class B {
|
||||
string name;
|
||||
int number;
|
||||
virtual bool operator==(const B& a) const { return name == a.name && number == a.number; }
|
||||
virtual bool operator==(const B& a) const
|
||||
{
|
||||
return name == a.name && number == a.number;
|
||||
}
|
||||
// ...
|
||||
};
|
||||
|
||||
@@ -4973,7 +4976,10 @@ It is really hard to write a foolproof and useful `==` for a hierarchy.
|
||||
|
||||
class D :B {
|
||||
char character;
|
||||
virtual bool operator==(const D& a) const { return name == a.name && number == a.number && character == a.character; }
|
||||
virtual bool operator==(const D& a) const
|
||||
{
|
||||
return name == a.name && number == a.number && character == a.character;
|
||||
}
|
||||
// ...
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user