Skip to content

Commit

Permalink
Insert std::move() as suggested by @laramiel
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Jul 26, 2024
1 parent c02d2cd commit 99b6572
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/pybind11/pybind11.h
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ struct property_cpp_function<
static cpp_function write(PM pm, const handle &hdl) {
detail::type_info *tinfo = detail::get_type_info(typeid(T), /*throw_if_missing=*/true);
if (tinfo->holder_enum_v == detail::holder_enum_t::smart_holder) {
return cpp_function([pm](T &c, D value) { c.*pm = std::forward<D>(value); },
return cpp_function([pm](T &c, D value) { c.*pm = std::forward<D>(std::move(value)); },
is_method(hdl));
}
return cpp_function([pm](T &c, const D &value) { c.*pm = value; }, is_method(hdl));
Expand Down

0 comments on commit 99b6572

Please sign in to comment.