Skip to content

Commit

Permalink
Remove std::move to resolve clang-tidy error:
Browse files Browse the repository at this point in the history
```
/__w/pybind11/pybind11/include/pybind11/functional.h:47:67: error: passing result of std::move() as a const reference argument; no move will actually happen [performance-move-const-arg,-warnings-as-errors]
   47 |     explicit func_wrapper_base(func_handle &&hf) noexcept : hfunc(std::move(hf)) {}
      |                                                                   ^~~~~~~~~~  ~
/__w/pybind11/pybind11/include/pybind11/functional.h:23:8: note: 'func_handle' is not move assignable/constructible
```
  • Loading branch information
rwgk committed Aug 6, 2024
1 parent 50361b1 commit 369daf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/pybind11/functional.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct func_handle {
// to emulate 'move initialization capture' in C++11
struct func_wrapper_base {
func_handle hfunc;
explicit func_wrapper_base(func_handle &&hf) noexcept : hfunc(std::move(hf)) {}
explicit func_wrapper_base(func_handle &&hf) noexcept : hfunc(hf) {}
};

template <typename Return, typename... Args>
Expand Down

0 comments on commit 369daf5

Please sign in to comment.