Skip to content

Commit ae34289

Browse files
committed
pybind#5162 applied to pybind11k
1 parent cf8345e commit ae34289

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Diff for: include/pybind11/cast.h

+10-5
Original file line numberDiff line numberDiff line change
@@ -841,23 +841,27 @@ class tuple_caster {
841841
protected:
842842
template <size_t... Is>
843843
type implicit_cast(index_sequence<Is...>) & {
844-
return type(cast_op<Ts>(std::get<Is>(subcasters))...);
844+
using std::get;
845+
return type(cast_op<Ts>(get<Is>(subcasters))...);
845846
}
846847
template <size_t... Is>
847848
type implicit_cast(index_sequence<Is...>) && {
848-
return type(cast_op<Ts>(std::move(std::get<Is>(subcasters)))...);
849+
using std::get;
850+
return type(cast_op<Ts>(std::move(get<Is>(subcasters)))...);
849851
}
850852

851853
static constexpr bool load_impl(const sequence &, bool, index_sequence<>) { return true; }
852854

853855
template <size_t... Is>
854856
bool load_impl(const sequence &seq, bool convert, index_sequence<Is...>) {
857+
using std::get;
858+
855859
#ifdef __cpp_fold_expressions
856-
if ((... || !std::get<Is>(subcasters).load(seq[Is], convert))) {
860+
if ((... || !get<Is>(subcasters).load(seq[Is], convert))) {
857861
return false;
858862
}
859863
#else
860-
for (bool r : {std::get<Is>(subcasters).load(seq[Is], convert)...}) {
864+
for (bool r : {get<Is>(subcasters).load(seq[Is], convert)...}) {
861865
if (!r) {
862866
return false;
863867
}
@@ -872,10 +876,11 @@ class tuple_caster {
872876
const return_value_policy_pack &rvpp,
873877
handle parent,
874878
index_sequence<Is...>) {
879+
using std::get;
875880
PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(src, rvpp, parent);
876881
PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(rvpp, parent);
877882
std::array<object, size> entries{{reinterpret_steal<object>(
878-
make_caster<Ts>::cast(std::get<Is>(std::forward<T>(src)), rvpp.get(Is), parent))...}};
883+
make_caster<Ts>::cast(get<Is>(std::forward<T>(src)), rvpp.get(Is), parent))...}};
879884
for (const auto &entry : entries) {
880885
if (!entry) {
881886
return handle();

0 commit comments

Comments
 (0)