Consider the below code:
Bar my_f()
{
Foo f{args,to,create,foo};
Bar b{std::move(f),other,args}; //Is move here unnecessary?
// code that does not use f;
return b;
}
Is compiler required to check {code that does not use f}
and automatically move f
into b
?