Skip to content

Commit e526ca6

Browse files
author
MarcoFalke
committed
Merge #10835: Rename member field according to the style guide
4d4fb33 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
2 parents 67f6f1c + 4d4fb33 commit e526ca6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/reverse_iterator.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Taken from https://gist.github.com/arvidsson/7231973
22

3-
#ifndef BITCOIN_REVERSE_ITERATOR_HPP
4-
#define BITCOIN_REVERSE_ITERATOR_HPP
3+
#ifndef BITCOIN_REVERSE_ITERATOR_H
4+
#define BITCOIN_REVERSE_ITERATOR_H
55

66
/**
77
* Template used for reverse iteration in C++11 range-based for loops.
@@ -14,19 +14,19 @@
1414
template <typename T>
1515
class reverse_range
1616
{
17-
T &x;
17+
T &m_x;
1818

1919
public:
20-
reverse_range(T &x) : x(x) {}
20+
reverse_range(T &x) : m_x(x) {}
2121

22-
auto begin() const -> decltype(this->x.rbegin())
22+
auto begin() const -> decltype(this->m_x.rbegin())
2323
{
24-
return x.rbegin();
24+
return m_x.rbegin();
2525
}
2626

27-
auto end() const -> decltype(this->x.rend())
27+
auto end() const -> decltype(this->m_x.rend())
2828
{
29-
return x.rend();
29+
return m_x.rend();
3030
}
3131
};
3232

@@ -36,4 +36,4 @@ reverse_range<T> reverse_iterate(T &x)
3636
return reverse_range<T>(x);
3737
}
3838

39-
#endif // BITCOIN_REVERSE_ITERATOR_HPP
39+
#endif // BITCOIN_REVERSE_ITERATOR_H

0 commit comments

Comments
 (0)