I have been looking through the Clang source code and I found this snippet:
void CompilerInstance::setInvocation(
std::shared_ptr<CompilerInvocation> Value) {
Invocation = std::move(Value);
}
Why would I want to std::move
an std::shared_ptr
?
Is there any point transferring ownership on a shared resource?
Why wouldn't I just do this instead?
void CompilerInstance::setInvocation(
std::shared_ptr<CompilerInvocation> Value) {
Invocation = Value;
}
Aucun commentaire:
Enregistrer un commentaire