From 0b949e0e9f01a7fafc96d1cd81113a44045d40ae Mon Sep 17 00:00:00 2001 From: Ahmed Charles Date: Mon, 3 Mar 2014 07:15:46 +0000 Subject: [PATCH] [C++11] Pass unique_ptr by value instead of &&. Suggestion by Richard Smith. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202678 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/OwningPtr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/llvm/ADT/OwningPtr.h b/include/llvm/ADT/OwningPtr.h index 4ee00ef6e80..5453d5c84e4 100644 --- a/include/llvm/ADT/OwningPtr.h +++ b/include/llvm/ADT/OwningPtr.h @@ -40,9 +40,9 @@ public: return *this; } - OwningPtr(std::unique_ptr &&Other) : Ptr(Other.release()) {} + OwningPtr(std::unique_ptr Other) : Ptr(Other.release()) {} - OwningPtr &operator=(std::unique_ptr &&Other) { + OwningPtr &operator=(std::unique_ptr Other) { reset(Other.release()); return *this; } -- 2.34.1