Skip to content

Commit ada6b3e

Browse files
committed
fix: try to get MSVC support
1 parent 41e909b commit ada6b3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/pybind11/pybind11.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,15 +1979,15 @@ struct iterator_access {
19791979
template <typename Iterator, typename ResultType = decltype(((*std::declval<Iterator>()).first)) >
19801980
struct iterator_key_access {
19811981
using result_type = decltype(((*std::declval<Iterator>()).first));
1982-
result_type operator()(Iterator &it) const {
1982+
typename std::add_lvalue_reference<result_type>::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 {
19891989
using result_type = decltype(((*std::declval<Iterator>()).second));
1990-
result_type operator()(Iterator &it) const {
1990+
typename std::add_lvalue_reference<result_type>::type operator()(Iterator &it) const {
19911991
return (*it).second;
19921992
}
19931993
};

0 commit comments

Comments
 (0)