aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private/SkNoncopyable.h
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2018-07-16 17:44:06 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-17 21:39:51 +0000
commitd5148e331436b69e3de1a35d4bfa8492e89b3cce (patch)
treefdf0a1dc5c8347ea75d57b0ed55af835f3a31d40 /include/private/SkNoncopyable.h
parent21a99d42c34f44dac4a71cace9572dc244cad583 (diff)
Move SkNoncopyable to include/private.
Change-Id: I62f60ea52faeebddecacf03d9429ac3f7c516b8e Reviewed-on: https://skia-review.googlesource.com/141823 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'include/private/SkNoncopyable.h')
-rw-r--r--include/private/SkNoncopyable.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/private/SkNoncopyable.h b/include/private/SkNoncopyable.h
new file mode 100644
index 0000000000..518b3eeb92
--- /dev/null
+++ b/include/private/SkNoncopyable.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2006 The Android Open Source Project
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkNoncopyable_DEFINED
+#define SkNoncopyable_DEFINED
+
+#include "SkTypes.h"
+
+/** \class SkNoncopyable
+
+ SkNoncopyable is the base class for objects that do not want to
+ be copied. It hides its copy-constructor and its assignment-operator.
+*/
+class SK_API SkNoncopyable {
+public:
+ SkNoncopyable() = default;
+
+ SkNoncopyable(SkNoncopyable&&) = default;
+ SkNoncopyable& operator =(SkNoncopyable&&) = default;
+
+private:
+ SkNoncopyable(const SkNoncopyable&) = delete;
+ SkNoncopyable& operator=(const SkNoncopyable&) = delete;
+};
+
+#endif