Why arguments moved twice when constructing std::thread
问题 Consider this program that essentially creates std::thread that calls the function func() with arg as argument: #include <thread> #include <iostream> struct foo { foo() = default; foo(const foo&) { std::cout << "copy ctor" << std::endl; } foo(foo&&) noexcept { std::cout << "move ctor" << std::endl; } }; void func(foo){} int main() { foo arg; std::thread th(func, arg); th.join(); } My output is copy ctor move ctor move ctor As far as I understand arg is copied internally in the thread object