This check finds macro expansions of DISALLOW_COPY_AND_ASSIGN(Type) and
replaces them with a deleted copy constructor and a deleted assignment operator.
Before the delete keyword was introduced in C++11 it was common practice to
declare a copy constructor and an assignment operator as a private members. This
effectively makes them unusable to the public API of a class.
With the advent of the delete keyword in C++11 we can abandon the
private access of the copy constructor and the assignment operator and
delete the methods entirely.
Migration example:
class Foo {
private:
- DISALLOW_COPY_AND_ASSIGN(Foo);
+ Foo(const Foo &) = delete;
+ const Foo &operator=(const Foo &) = delete;
};
I think check should work in C++11 or newer.