Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4138)

Unified Diff: base/memory/scoped_ptr_unittest.cc

Issue 1454993003: Add a move constructor and move assignment operator to scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a real move constructor Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« base/memory/scoped_ptr.h ('K') | « base/memory/scoped_ptr.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/scoped_ptr_unittest.cc
diff --git a/base/memory/scoped_ptr_unittest.cc b/base/memory/scoped_ptr_unittest.cc
index ad49f4ff5cc43c3fcc969b736feebe4ec9cdcc11..fe4f187d0106e1627d7aba65c9f1e72ea3f314c9 100644
--- a/base/memory/scoped_ptr_unittest.cc
+++ b/base/memory/scoped_ptr_unittest.cc
@@ -5,6 +5,7 @@
#include "base/memory/scoped_ptr.h"
#include <sstream>
+#include <utility>
#include "base/basictypes.h"
#include "base/bind.h"
@@ -872,3 +873,14 @@ TEST(ScopedPtrTest, ArrayOperators) {
EXPECT_TRUE(pnull <= nullptr);
EXPECT_TRUE(nullptr <= pnull);
}
+
+namespace {
+scoped_ptr<int> Thinger() {
+ scoped_ptr<int> r(new int);
+ return std::move(r);
+}
+}
+
+TEST(ScopedPtrTest, MooMoo) {
+ Thinger();
+}
« base/memory/scoped_ptr.h ('K') | « base/memory/scoped_ptr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698