Skip to content

Instantly share code, notes, and snippets.

@leesei
Created May 13, 2014 09:02
Show Gist options
  • Save leesei/90e1714aa3f419522799 to your computer and use it in GitHub Desktop.
Save leesei/90e1714aa3f419522799 to your computer and use it in GitHub Desktop.
#c #evil-c-tor #c-tor
// 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) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
// An older, deprecated, politically incorrect name for the above.
// NOTE: The usage of this macro was baned from our code base, but some
// third_party libraries are yet using it.
// TODO(tfarina): Figure out how to fix the usage of this macro in the
// third_party libraries and get rid of it.
#define DISALLOW_EVIL_CONSTRUCTORS(TypeName) DISALLOW_COPY_AND_ASSIGN(TypeName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment