diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 0c862e4be..4f9ef97f5 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -685,23 +685,27 @@ public: protected: template type implicit_cast(index_sequence) & { - return type(cast_op(std::get(subcasters))...); + using std::get; + return type(cast_op(get(subcasters))...); } template type implicit_cast(index_sequence) && { - return type(cast_op(std::move(std::get(subcasters)))...); + using std::get; + return type(cast_op(std::move(get(subcasters)))...); } static constexpr bool load_impl(const sequence &, bool, index_sequence<>) { return true; } template bool load_impl(const sequence &seq, bool convert, index_sequence) { + using std::get; + #ifdef __cpp_fold_expressions - if ((... || !std::get(subcasters).load(seq[Is], convert))) { + if ((... || !get(subcasters).load(seq[Is], convert))) { return false; } #else - for (bool r : {std::get(subcasters).load(seq[Is], convert)...}) { + for (bool r : {get(subcasters).load(seq[Is], convert)...}) { if (!r) { return false; } @@ -714,10 +718,11 @@ protected: template static handle cast_impl(T &&src, return_value_policy policy, handle parent, index_sequence) { + using std::get; PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(src, policy, parent); PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(policy, parent); std::array entries{{reinterpret_steal( - make_caster::cast(std::get(std::forward(src)), policy, parent))...}}; + make_caster::cast(get(std::forward(src)), policy, parent))...}}; for (const auto &entry : entries) { if (!entry) { return handle();