]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
cls/fifo: use friend instead of member operators
authorKefu Chai <tchaikov@gmail.com>
Mon, 14 Mar 2022 15:35:13 +0000 (23:35 +0800)
committerKefu Chai <tchaikov@gmail.com>
Thu, 17 Mar 2022 14:00:36 +0000 (22:00 +0800)
commitf5c3ae2af8068d33c7f108d120266f0b06c43682
treebb338716ba167a97c280e10669e101a05518776d
parent0713db5a9456098a737cb3597fff577233e83310
cls/fifo: use friend instead of member operators

to address following error when compiling with C++20 standard:

../src/rgw/cls_fifo_legacy.cc:2217:22: error: ISO C++20 considers use of overloaded operator '==' (with operand types 'rados::cls::fifo::journal_entry' and 'rados::cls::fifo::journal_entry') to be ambiguous despite there being a unique best viable function [-Werror,-Wambiguous-reversed-operator]
            !(jiter->second == e)) {
              ~~~~~~~~~~~~~ ^  ~
../src/cls/fifo/cls_fifo_types.h:148:8: note: ambiguity is between a regular call to this operator and a call with the argument order reversed
  bool operator ==(const journal_entry& e) {
       ^

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/cls/fifo/cls_fifo_types.h