From: Casey Bodley Date: Wed, 15 Nov 2017 21:03:00 +0000 (-0500) Subject: common: fix BoundedKeyCounter const_pointer_iterator X-Git-Tag: v13.0.1~207^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F18953%2Fhead;p=ceph.git common: fix BoundedKeyCounter const_pointer_iterator with libc++, clang fails to compile a call to: vector::assign(const_pointer_iterator, const_pointer_iterator) because const_pointer_iterator does not satisfy the InputIterator concept. added the necessary typedefs for value_type and reference to reflect the pointer type Fixes: http://tracker.ceph.com/issues/22139 Signed-off-by: Casey Bodley --- diff --git a/src/common/bounded_key_counter.h b/src/common/bounded_key_counter.h index e5aa52210df7..0109a26ef1bc 100644 --- a/src/common/bounded_key_counter.h +++ b/src/common/bounded_key_counter.h @@ -73,7 +73,11 @@ class BoundedKeyCounter { struct const_pointer_iterator : public map_type::const_iterator { const_pointer_iterator(typename map_type::const_iterator i) : map_type::const_iterator(i) {} - const value_type* operator*() const { + + using value_type = typename map_type::const_iterator::value_type*; + using reference = const typename map_type::const_iterator::value_type*; + + reference operator*() const { return &map_type::const_iterator::operator*(); } };