Commit cec5fdea authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[base] Fix macros and comments for C++11

Since the DISALLOW_* macros now use the C++11 syntax "= delete", it
does not matter whether they are used in the public or the private
section of a class definition.
In fact, the style guide recomments putting deleted constructors or
assignment operators in the public section.
Thus, remove the hint to put them in the private: declarations.

Drive-by: Fix the syntax of the deleted copy assignment operator.

R=thakis@chromium.org

Change-Id: I10af0d71c18dc1f3b08e4601ae571ed53d8c71e3
Reviewed-on: https://chromium-review.googlesource.com/578027Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488172}
parent 2cec5853
......@@ -17,21 +17,16 @@
TypeName(const TypeName&) = delete
// Put this in the declarations for a class to be unassignable.
#define DISALLOW_ASSIGN(TypeName) \
void operator=(const TypeName&) = delete
#define DISALLOW_ASSIGN(TypeName) TypeName& operator=(const TypeName&) = delete
// A macro to disallow the copy constructor and operator= functions.
// This should be used in the private: declarations for a class.
// Put this in the declarations for a class to be uncopyable and unassignable.
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&) = delete; \
void operator=(const TypeName&) = delete
DISALLOW_COPY(TypeName); \
DISALLOW_ASSIGN(TypeName)
// A macro to disallow all the implicit constructors, namely the
// default constructor, copy constructor and operator= functions.
//
// This should be used in the private: declarations for a class
// that wants to prevent anyone from instantiating it. This is
// especially useful for classes containing only static methods.
// This is especially useful for classes containing only static methods.
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
TypeName() = delete; \
DISALLOW_COPY_AND_ASSIGN(TypeName)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment