C++ performs copy elision of return values if:
1. The value is a local declared in the function (i.e. not a
parameter)
2. The type of the value in the return statement is, modulo
const-value qualification, identical to the return type of the
function.
An RValue reference to a type is not identical, modulo const-value
qualification, to the type it is a reference to.
Do not std::move local values in the return statement unless the value
is a parameter or you will make the compiler perform a copy it would
iotherwise avoid.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
dest.append("\n");
}
- return std::move(dest);
+ return dest;
}
/*
}
dout(10) << "get_canon_resource(): dest=" << dest << dendl;
- return std::move(dest);
+ return dest;
}
/*