Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: code conventions

...

Code Block
bgColor#ccccff
langcpp
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) {
    // ...
  }
}

...