]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
buffer: constrain conversions of buffers_t iterators
authorCasey Bodley <cbodley@redhat.com>
Fri, 11 Feb 2022 23:26:22 +0000 (18:26 -0500)
committerKefu Chai <tchaikov@gmail.com>
Thu, 17 Mar 2022 14:00:35 +0000 (22:00 +0800)
commitcc063d5395a25db9a675f6012e4c204057485a31
tree45962d4a2a547b56ca8e7634c6723b4b63540c3b
parent773dabfcd6f263a0039e8596659276b33c637eb8
buffer: constrain conversions of buffers_t iterators

prevent conversions from const_iterator -> iterator to resolve a c++20
compilation error with clang 13:

ceph/src/include/buffer.h:537:18: error: use of overloaded operator '==' is ambiguous (with operand types 'ceph::buffer::list::buffers_t::const_iterator' (aka 'buffers_iterator<const ceph::buffer::ptr_node>') and 'ceph::buffer::list::buffers_t::iterator' (aka 'buffers_iterator<ceph::buffer::ptr_node>'
))
        _root.next = it == end() ? &item : _root.next;
                     ~~ ^  ~~~~~
ceph/src/include/buffer.h:471:7: note: candidate function
        bool operator==(const buffers_iterator& rhs) const {
             ^
ceph/src/include/buffer.h:471:7: note: candidate function (with reversed parameter order)

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/include/buffer.h