Skip to content

Commit

Permalink
Fix ambiguous-reversed-operator for Folly::Cursor
Browse files Browse the repository at this point in the history
Differential Revision: D47618893

fbshipit-source-id: d92bfca5d66df6db3f39568d177f0f019bb079cc
  • Loading branch information
JoostHouben authored and facebook-github-bot committed Jul 22, 2023
1 parent 52e1e59 commit 502293d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions folly/io/Cursor.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class CursorBase {
* Two cursors are equal if they are pointing to the same location in the
* same IOBuf chain.
*/
bool operator==(const Derived& other) const {
bool operator==(const CursorBase& other) const {
const IOBuf* crtBuf = crtBuf_;
auto crtPos = crtPos_;
// We can be pointing to the end of a buffer chunk, find first non-empty.
Expand All @@ -299,7 +299,8 @@ class CursorBase {
}
return (crtPos == crtPosOther) && (crtBuf == crtBufOther);
}
bool operator!=(const Derived& other) const { return !operator==(other); }

bool operator!=(const CursorBase& other) const { return !operator==(other); }

template <class T>
typename std::enable_if<std::is_arithmetic<T>::value, bool>::type tryRead(
Expand Down

0 comments on commit 502293d

Please sign in to comment.