Merge #10835: Rename member field according to the style guide

4d4fb33fc Rename member field according to the style guide. (Pavel Janík)

Pull request description:

  After #10193, approx. five instances of this warning are printed when compiling with `-Wshadow`:

  ```
  In file included from txmempool.cpp:14:
  ./reverse_iterator.h:20:22: warning: declaration shadows a field of 'reverse_range<T>' [-Wshadow]
      reverse_range(T &x) : x(x) {}
                       ^
  ./reverse_iterator.h:17:8: note: previous declaration is here
      T &x;
         ^
  1 warning generated.
  ```

Tree-SHA512: 6c07c2ed6f4f232a3a8bdcdd6057040967c74552fd29d80f42e8a453b95baf203c410aa31dccc08ff2e765cbba02b1a282f6ea7804955f09b31ab20ef383792e
pull/384/head
MarcoFalke 7 years ago
commit e526ca6284
No known key found for this signature in database
GPG Key ID: D2EA4850E7528B25

@ -1,7 +1,7 @@
// Taken from https://gist.github.com/arvidsson/7231973 // Taken from https://gist.github.com/arvidsson/7231973
#ifndef BITCOIN_REVERSE_ITERATOR_HPP #ifndef BITCOIN_REVERSE_ITERATOR_H
#define BITCOIN_REVERSE_ITERATOR_HPP #define BITCOIN_REVERSE_ITERATOR_H
/** /**
* Template used for reverse iteration in C++11 range-based for loops. * Template used for reverse iteration in C++11 range-based for loops.
@ -14,19 +14,19 @@
template <typename T> template <typename T>
class reverse_range class reverse_range
{ {
T &x; T &m_x;
public: public:
reverse_range(T &x) : x(x) {} reverse_range(T &x) : m_x(x) {}
auto begin() const -> decltype(this->x.rbegin()) auto begin() const -> decltype(this->m_x.rbegin())
{ {
return x.rbegin(); return m_x.rbegin();
} }
auto end() const -> decltype(this->x.rend()) auto end() const -> decltype(this->m_x.rend())
{ {
return x.rend(); return m_x.rend();
} }
}; };
@ -36,4 +36,4 @@ reverse_range<T> reverse_iterate(T &x)
return reverse_range<T>(x); return reverse_range<T>(x);
} }
#endif // BITCOIN_REVERSE_ITERATOR_HPP #endif // BITCOIN_REVERSE_ITERATOR_H

Loading…
Cancel
Save