Functions with what looks like pass by value unique_ptr parameters aren't really. The functions are expressing ownership of the pointer and callers must use std::move at the call.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For me, the problem is only in the std::move is used in the initialization list. In the following example, cppcheck is reporting an issue only in line 6 (constructor) while it's not reporting an issue for line 8 (function). I'm using cppcheck 1.82.
Functions with what looks like pass by value unique_ptr parameters aren't really. The functions are expressing ownership of the pointer and callers must use std::move at the call.
For me, the problem is only in the std::move is used in the initialization list. In the following example, cppcheck is reporting an issue only in line 6 (constructor) while it's not reporting an issue for line 8 (function). I'm using cppcheck 1.82.
Thanks! I created the ticket https://trac.cppcheck.net/ticket/8570