summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authordbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-07 00:43:59 +0000
committerdbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-07 00:43:59 +0000
commitcdcfcd5dc89aca09361ac524f7d378475d171ada (patch)
tree15fcba6e27dc4b288fc32f371dddf3dafcf0bee6 /base
parent17c373ec98c893974f1525dbe957b658ffa03aae (diff)
downloadchromium_src-cdcfcd5dc89aca09361ac524f7d378475d171ada.zip
chromium_src-cdcfcd5dc89aca09361ac524f7d378475d171ada.tar.gz
chromium_src-cdcfcd5dc89aca09361ac524f7d378475d171ada.tar.bz2
Splitting the functionality of DISALLOW_COPY_AND_ASSIGN() into DISALLOW_COPY()
and DISALLOW_ASSIGN(). R=mark@chromium.org BUG=none TEST=I can disallow copy OR assign :). Review URL: https://chromiumcodereview.appspot.com/12510004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186556 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/basictypes.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/base/basictypes.h b/base/basictypes.h
index 8210554..b16ada5 100644
--- a/base/basictypes.h
+++ b/base/basictypes.h
@@ -68,6 +68,14 @@ const int32 kint32max = (( int32) 0x7FFFFFFF);
const int64 kint64min = (( int64) GG_LONGLONG(0x8000000000000000));
const int64 kint64max = (( int64) GG_LONGLONG(0x7FFFFFFFFFFFFFFF));
+// Put this in the private: declarations for a class to be uncopyable.
+#define DISALLOW_COPY(TypeName) \
+ TypeName(const TypeName&)
+
+// Put this in the private: declarations for a class to be unassignable.
+#define DISALLOW_ASSIGN(TypeName) \
+ void operator=(const TypeName&)
+
// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \