Add operator[] to autovector::iterator_impl. (#6047)

Summary:
This is a required operator for random-access iterators, and an upcoming update for Visual Studio 2019 will change the C++ Standard Library's heap algorithms to use this operator.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6047

Differential Revision: D18618531

Pulled By: ltamasi

fbshipit-source-id: 08d10bc85bf2dbc3f7ef0fa3c777e99f1e927ef5
main
Stephan T. Lavavej 5 years ago committed by Facebook Github Bot
parent 27ec3b3466
commit 3cd75736a7
  1. 8
      util/autovector.h

@ -140,6 +140,14 @@ class autovector {
return &(*vect_)[index_];
}
reference operator[](difference_type len) {
return *(*this + len);
}
const_reference operator[](difference_type len) const {
return *(*this + len);
}
// -- Logical Operators
bool operator==(const self_type& other) const {

Loading…
Cancel
Save