Skip to content

Commit 0bcfbd4

Browse files
committed
Call property_cpp_function_classic member functions, rather than inlining the implementations.
1 parent 16cf7ad commit 0bcfbd4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

include/pybind11/pybind11.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,7 +1674,7 @@ struct property_cpp_function_sh_raw_ptr_member {
16741674
},
16751675
is_method(hdl));
16761676
}
1677-
return cpp_function([pm](const T &c) -> const D & { return c.*pm; }, is_method(hdl));
1677+
return property_cpp_function_classic<T, D>::readonly(pm, hdl);
16781678
}
16791679

16801680
template <typename PM, must_be_member_function_pointer<PM> = 0>
@@ -1689,7 +1689,7 @@ struct property_cpp_function_sh_raw_ptr_member {
16891689
return cpp_function([pm](T &c, D value) { c.*pm = std::forward<D>(std::move(value)); },
16901690
is_method(hdl));
16911691
}
1692-
return cpp_function([pm](T &c, const D &value) { c.*pm = value; }, is_method(hdl));
1692+
return property_cpp_function_classic<T, D>::write(pm, hdl);
16931693
}
16941694
};
16951695

@@ -1714,7 +1714,7 @@ struct property_cpp_function_sh_member_held_by_value {
17141714
},
17151715
is_method(hdl));
17161716
}
1717-
return cpp_function([pm](const T &c) -> const D & { return c.*pm; }, is_method(hdl));
1717+
return property_cpp_function_classic<T, D>::readonly(pm, hdl);
17181718
}
17191719

17201720
template <typename PM, must_be_member_function_pointer<PM> = 0>
@@ -1730,7 +1730,7 @@ struct property_cpp_function_sh_member_held_by_value {
17301730
},
17311731
is_method(hdl));
17321732
}
1733-
return cpp_function([pm](const T &c) -> const D & { return c.*pm; }, is_method(hdl));
1733+
return property_cpp_function_classic<T, D>::read(pm, hdl);
17341734
}
17351735

17361736
template <typename PM, must_be_member_function_pointer<PM> = 0>
@@ -1739,7 +1739,7 @@ struct property_cpp_function_sh_member_held_by_value {
17391739
if (tinfo->holder_enum_v == holder_enum_t::smart_holder) {
17401740
return cpp_function([pm](T &c, const D &value) { c.*pm = value; }, is_method(hdl));
17411741
}
1742-
return cpp_function([pm](T &c, const D &value) { c.*pm = value; }, is_method(hdl));
1742+
return property_cpp_function_classic<T, D>::write(pm, hdl);
17431743
}
17441744
};
17451745

@@ -1772,7 +1772,7 @@ struct property_cpp_function_sh_unique_ptr_member {
17721772
},
17731773
is_method(hdl));
17741774
}
1775-
return cpp_function([pm](const T &c) -> const D & { return c.*pm; }, is_method(hdl));
1775+
return property_cpp_function_classic<T, D>::read(pm, hdl);
17761776
}
17771777

17781778
template <typename PM, must_be_member_function_pointer<PM> = 0>

0 commit comments

Comments
 (0)