Skip to content

Commit f1e6b20

Browse files
committed
fix: extra parens matter?
1 parent 49c04c3 commit f1e6b20

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/pybind11/pybind11.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,15 +1976,15 @@ struct iterator_access {
19761976
}
19771977
};
19781978

1979-
template <typename Iterator, typename ResultType = decltype((*std::declval<Iterator>()).first) >
1979+
template <typename Iterator, typename ResultType = decltype(((*std::declval<Iterator>()).first)) >
19801980
struct iterator_key_access {
19811981
using result_type = ResultType;
19821982
result_type operator()(Iterator &it) const {
19831983
return (*it).first;
19841984
}
19851985
};
19861986

1987-
template <typename Iterator, typename ResultType = decltype((*std::declval<Iterator>()).second)>
1987+
template <typename Iterator, typename ResultType = decltype(((*std::declval<Iterator>()).second))>
19881988
struct iterator_value_access {
19891989
using result_type = ResultType;
19901990
result_type operator()(Iterator &it) const {

tests/test_sequences_and_iterators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_generalized_iterators():
2323

2424
# keep_alive can't be attached
2525
with pytest.raises(RuntimeError):
26-
m.IntPairs([(1, 2), (3, 4), (0, 5)]).make_iterator_keep_alive()
26+
list(m.IntPairs([(1, 2), (3, 4), (0, 5)]).make_iterator_keep_alive())
2727

2828
assert list(m.IntPairs([(1, 2), (3, 4), (0, 5)]).nonzero_keys()) == [1, 3]
2929
assert list(m.IntPairs([(1, 2), (2, 0), (0, 3), (4, 5)]).nonzero_keys()) == [1]

0 commit comments

Comments
 (0)