default keyword

The default keyword tells the compiler to independently generate the corresponding class function, if one is not declared in the class.

Use the default implementation. Why use it? Default is public. You can redeclare it under protected.

We see an example of this in CS247 in lecture 12:

class AbstractBook {
	string title, author;
	int length;
	protected:
		AbstractBook& operator=(const AbstractBook& other) = default;
	public:
		AbstractBook(...) {}
		virtual ~AbstractBook() = 0;
 
}