]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: fix BoundedKeyCounter const_pointer_iterator 21083/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 15 Nov 2017 21:03:00 +0000 (16:03 -0500)
committerPrashant D <pdhange@redhat.com>
Wed, 28 Mar 2018 04:16:55 +0000 (00:16 -0400)
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 <cbodley@redhat.com>
(cherry picked from commit fa034b69982285b800b0d85d1054a3c25a88d625)

src/common/bounded_key_counter.h

index e5aa52210df7e0da0a6d69ab16e5909eb863e397..0109a26ef1bcc36e69d58f83272f01d0af148bf2 100644 (file)
@@ -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*();
     }
   };