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

Side by Side Diff: base/basictypes.h

Issue 2657005: Get rid of DISALLOW_EVIL_CONSTRUCTORS macro usage in our code base. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: added the macro back Created 10 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | gfx/icon_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_BASICTYPES_H_ 5 #ifndef BASE_BASICTYPES_H_
6 #define BASE_BASICTYPES_H_ 6 #define BASE_BASICTYPES_H_
7 7
8 #include <limits.h> // So we can set the bounds of our types 8 #include <limits.h> // So we can set the bounds of our types
9 #include <stddef.h> // For size_t 9 #include <stddef.h> // For size_t
10 #include <string.h> // for memcpy 10 #include <string.h> // for memcpy
11 11
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 const int64 kint64min = (( int64) GG_LONGLONG(0x8000000000000000)); 75 const int64 kint64min = (( int64) GG_LONGLONG(0x8000000000000000));
76 const int64 kint64max = (( int64) GG_LONGLONG(0x7FFFFFFFFFFFFFFF)); 76 const int64 kint64max = (( int64) GG_LONGLONG(0x7FFFFFFFFFFFFFFF));
77 77
78 // A macro to disallow the copy constructor and operator= functions 78 // A macro to disallow the copy constructor and operator= functions
79 // This should be used in the private: declarations for a class 79 // This should be used in the private: declarations for a class
80 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ 80 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
81 TypeName(const TypeName&); \ 81 TypeName(const TypeName&); \
82 void operator=(const TypeName&) 82 void operator=(const TypeName&)
83 83
84 // An older, deprecated, politically incorrect name for the above. 84 // An older, deprecated, politically incorrect name for the above.
85 // NOTE: The usage of this macro was baned from our code base, but some
86 // third_party libraries are yet using it.
87 // TODO(tfarina): Figure out how to fix the usage of this macro in the
88 // third_party libraries and get rid of it.
85 #define DISALLOW_EVIL_CONSTRUCTORS(TypeName) DISALLOW_COPY_AND_ASSIGN(TypeName) 89 #define DISALLOW_EVIL_CONSTRUCTORS(TypeName) DISALLOW_COPY_AND_ASSIGN(TypeName)
86 90
87 // A macro to disallow all the implicit constructors, namely the 91 // A macro to disallow all the implicit constructors, namely the
88 // default constructor, copy constructor and operator= functions. 92 // default constructor, copy constructor and operator= functions.
89 // 93 //
90 // This should be used in the private: declarations for a class 94 // This should be used in the private: declarations for a class
91 // that wants to prevent anyone from instantiating it. This is 95 // that wants to prevent anyone from instantiating it. This is
92 // especially useful for classes containing only static methods. 96 // especially useful for classes containing only static methods.
93 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ 97 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
94 TypeName(); \ 98 TypeName(); \
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 // constructor declared as 355 // constructor declared as
352 // explicit MyClass(base::LinkerInitialized x) {} 356 // explicit MyClass(base::LinkerInitialized x) {}
353 // and invoked as 357 // and invoked as
354 // static MyClass my_variable_name(base::LINKER_INITIALIZED); 358 // static MyClass my_variable_name(base::LINKER_INITIALIZED);
355 namespace base { 359 namespace base {
356 enum LinkerInitialized { LINKER_INITIALIZED }; 360 enum LinkerInitialized { LINKER_INITIALIZED };
357 } // base 361 } // base
358 362
359 363
360 #endif // BASE_BASICTYPES_H_ 364 #endif // BASE_BASICTYPES_H_
OLDNEW
« no previous file with comments | « no previous file | gfx/icon_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698