It's a syntax I've never seen in C++.
See the following:
class View
{
private:
int screenSize;
int screenScale; //"the ZOOM"
Point origin;
public:
const int minScreenSize = 6;
const int maxScreenSize = 30;
View():screenSize(25),screenScale(2),origin(-10,-10){}
~View() = default;
View(const View&) = default;
View(View&&) = default;
View& operator=(const View&) = default;
View& operator=(View&&) = default;
View& myAdd() = delete;
}
What is the meaning of:
View() = default and View() = delete?
Thanks in advance.
Constructor() = default;means that you explicitly want the compiler to generate the default constructor for that classConstructor() = delete;means that you explicitly forbid the usage of that constructor.