...
| Code Block | ||||
|---|---|---|---|---|
| ||||
struct S {
unsigned char buffType;
int size;
friend bool operator==(const S &LHSlhs, const S &RHSrhs) {
return LHSlhs.buffType == RHSrhs.buffType &&
LHSlhs.size == RHSrhs.size;
}
};
void f(const S &s1, const S &s2) {
if (s1 == s2) {
// ...
}
} |
...