I have been looking through the Clang source code and I found this snippet:
void CompilerInstance::setInvocation( std::shared_ptr
Copying a shared_ptr involves copying its internal state object pointer and changing the reference count. Moving it only involves swapping pointers to the internal reference counter, and the owned object, so it's faster.
shared_ptr