From a75c507e56702e383a3ee36f6fe9d795ddf90f35 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 15 Nov 2017 16:03:00 -0500 Subject: [PATCH] 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 (cherry picked from commit fa034b69982285b800b0d85d1054a3c25a88d625) --- src/common/bounded_key_counter.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/bounded_key_counter.h b/src/common/bounded_key_counter.h index e5aa52210df7e..0109a26ef1bcc 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*(); } }; -- 2.39.5