Skip to content

Commit e850621

Browse files
committed
fix: try avoiding use of SFINAE param in using
1 parent a7b0b90 commit e850621

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/pybind11/pybind11.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,7 +1969,7 @@ struct iterator_state {
19691969
// iterators in the wild can't be dereferenced when const. C++ needs the extra parens in decltype.
19701970
template <typename Iterator, typename ResultType = decltype((*std::declval<Iterator>()))>
19711971
struct iterator_access {
1972-
using result_type = ResultType;
1972+
using result_type = decltype((*std::declval<Iterator>()));
19731973
// NOLINTNEXTLINE(readability-const-return-type) // PR #3263
19741974
result_type operator()(Iterator &it) const {
19751975
return *it;
@@ -1978,15 +1978,15 @@ struct iterator_access {
19781978

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

19871987
template <typename Iterator, typename ResultType = decltype(((*std::declval<Iterator>()).second))>
19881988
struct iterator_value_access {
1989-
using result_type = ResultType;
1989+
using result_type = decltype(((*std::declval<Iterator>()).second));
19901990
result_type operator()(Iterator &it) const {
19911991
return (*it).second;
19921992
}

0 commit comments

Comments
 (0)