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

Unified Diff: base/test/move_only_int.h

Issue 2898213003: Add skeleton circular queue file.
Patch Set: Fix merge 2 Created 3 years, 5 months 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
« no previous file with comments | « base/test/copy_only_int.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/move_only_int.h
diff --git a/base/test/move_only_int.h b/base/test/move_only_int.h
index 50b9c3b16601584a75b90a4d497f37ff40a314ff..71b1e820deeb1addf3138464c02278e92fb44bcd 100644
--- a/base/test/move_only_int.h
+++ b/base/test/move_only_int.h
@@ -2,20 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_CONTAINERS_CONTAINER_TEST_UTILS_H_
-#define BASE_CONTAINERS_CONTAINER_TEST_UTILS_H_
-
-// This file contains some helper classes for testing conainer behavior.
+#ifndef BASE_TEST_MOVE_ONLY_INT_H_
+#define BASE_TEST_MOVE_ONLY_INT_H_
#include "base/macros.h"
namespace base {
-// A move-only class that holds an integer.
+// A move-only class that holds an integer. This is designed for testing
+// containers. See also CopyOnlyInt.
class MoveOnlyInt {
public:
explicit MoveOnlyInt(int data = 1) : data_(data) {}
MoveOnlyInt(MoveOnlyInt&& other) : data_(other.data_) { other.data_ = 0; }
+ ~MoveOnlyInt() { data_ = 0; }
+
MoveOnlyInt& operator=(MoveOnlyInt&& other) {
data_ = other.data_;
other.data_ = 0;
@@ -64,4 +65,4 @@ class MoveOnlyInt {
} // namespace base
-#endif // BASE_CONTAINERS_CONTAINER_TEST_UTILS_H_
+#endif // BASE_TEST_MOVE_ONLY_INT_H_
« no previous file with comments | « base/test/copy_only_int.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698