Contact: aviboots(AT)netvision.net.il
40,848 questions
53,252 answers
573 users
#include <iostream> class Example { private: Example(); }; int main() { Example ex; // error: ‘Example::Example()’ is private within this context } /* run: error: ‘Example::Example()’ is private within this context */
#include <iostream> class Example { public: Example() = delete; }; int main() { Example ex; // error: ‘Example::Example()’ is private within this context } /* run: error: ‘Example::Example()’ is private within this context */