aboutsummaryrefslogtreecommitdiff
path: root/common/noncopyable.h
diff options
context:
space:
mode:
authorMax Horn2007-03-17 10:36:14 +0000
committerMax Horn2007-03-17 10:36:14 +0000
commit97514214349ed236c54fa6a91a0937b9c6073aab (patch)
tree0d1034f07270c91d629bdd5b62ff81f1bb2a20e8 /common/noncopyable.h
parentc1f4dbda7794fbc174668def400cbfe315f71f51 (diff)
downloadscummvm-rg350-97514214349ed236c54fa6a91a0937b9c6073aab.tar.gz
scummvm-rg350-97514214349ed236c54fa6a91a0937b9c6073aab.tar.bz2
scummvm-rg350-97514214349ed236c54fa6a91a0937b9c6073aab.zip
Added class NonCopyable, and made various things derive from it
svn-id: r26163
Diffstat (limited to 'common/noncopyable.h')
-rw-r--r--common/noncopyable.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/common/noncopyable.h b/common/noncopyable.h
new file mode 100644
index 0000000000..7fafc44121
--- /dev/null
+++ b/common/noncopyable.h
@@ -0,0 +1,43 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2002-2007 The ScummVM project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef COMMON_NONCOPYABLE_H
+#define COMMON_NONCOPYABLE_H
+
+namespace Common {
+
+/**
+ * Subclass of NonCopyable can not be copied due to the fact that
+ * we made the copy constructor and assigment operator private.
+ */
+class NonCopyable {
+public:
+ NonCopyable() {}
+private:
+ // Prevent copying instances by accident
+ NonCopyable(const NonCopyable&);
+ NonCopyable& operator= (const NonCopyable&);
+};
+
+} // End of namespace Common
+
+#endif