summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-oe/recipes-extended/minifi-cpp/files/0001-Fix-the-constness-issues-around-autovector-iterator_.patch
blob: cd837d8de40b35aa2d01cb823e88d75bc7779d6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From 787d5052a6034cc722b073c652cc610ae037f933 Mon Sep 17 00:00:00 2001
From: Levi Tamasi <ltamasi@fb.com>
Date: Fri, 22 Nov 2019 18:12:35 -0800
Subject: [PATCH 1/2] Fix the constness issues around
 autovector::iterator_impl's dereference operators (#6057)

Summary:
As described in detail in issue https://github.com/facebook/rocksdb/issues/6048, iterators' dereference operators
(`*`, `->`, and `[]`) should return `pointer`s/`reference`s (as opposed to
`const_pointer`s/`const_reference`s) even if the iterator itself is `const`
to be in sync with the standard's iterator concept.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6057

Test Plan: make check

Differential Revision: D18623235

Pulled By: ltamasi

fbshipit-source-id: 04e82d73bc0c67fb0ded018383af8dfc332050cc
---
Upstream-Status: Pending

 thirdparty/rocksdb/util/autovector.h | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/thirdparty/rocksdb/util/autovector.h b/thirdparty/rocksdb/util/autovector.h
index b5c84712..6d337908 100644
--- a/thirdparty/rocksdb/util/autovector.h
+++ b/thirdparty/rocksdb/util/autovector.h
@@ -120,27 +120,20 @@ class autovector {
     }
 
     // -- Reference
-    reference operator*() {
+    reference operator*() const {
       assert(vect_->size() >= index_);
       return (*vect_)[index_];
     }
 
-    const_reference operator*() const {
-      assert(vect_->size() >= index_);
-      return (*vect_)[index_];
-    }
-
-    pointer operator->() {
+    pointer operator->() const {
       assert(vect_->size() >= index_);
       return &(*vect_)[index_];
     }
 
-    const_pointer operator->() const {
-      assert(vect_->size() >= index_);
-      return &(*vect_)[index_];
+    reference operator[](difference_type len) const {
+      return *(*this + len);
     }
 
-
     // -- Logical Operators
     bool operator==(const self_type& other) const {
       assert(vect_ == other.vect_);
-- 
2.41.0