[llvm] r202678 - [C++11] Pass unique_ptr by value instead of &&.

Ahmed Charles ahmedcharles at gmail.com
Sun Mar 2 23:15:47 PST 2014


Author: ace2001ac
Date: Mon Mar  3 01:15:46 2014
New Revision: 202678

URL: http://llvm.org/viewvc/llvm-project?rev=202678&view=rev
Log:
[C++11] Pass unique_ptr by value instead of &&.

Suggestion by Richard Smith.

Modified:
    llvm/trunk/include/llvm/ADT/OwningPtr.h

Modified: llvm/trunk/include/llvm/ADT/OwningPtr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/OwningPtr.h?rev=202678&r1=202677&r2=202678&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/OwningPtr.h (original)
+++ llvm/trunk/include/llvm/ADT/OwningPtr.h Mon Mar  3 01:15:46 2014
@@ -40,9 +40,9 @@ public:
     return *this;
   }
 
-  OwningPtr(std::unique_ptr<T> &&Other) : Ptr(Other.release()) {}
+  OwningPtr(std::unique_ptr<T> Other) : Ptr(Other.release()) {}
 
-  OwningPtr &operator=(std::unique_ptr<T> &&Other) {
+  OwningPtr &operator=(std::unique_ptr<T> Other) {
     reset(Other.release());
     return *this;
   }





More information about the llvm-commits mailing list