DEV Community

Discussion on: Constructors in C++

Collapse
 
pgradot profile image
Pierre Gradot • Edited

Yes.

It is mandatory to have a private constructor implement the singleton design pattern (which is a pattern I quite highly discourage). See codereview.stackexchange.com/a/173935

A protected constructor is a way to create an abstract class. See stackoverflow.com/questions/105722...

Prior to C++11, private constructors were part of the technique to make classes uncopyable. See stackoverflow.com/a/2173764/12342718

Thread Thread
 
aniket1004 profile image
Aniket Chandrakant Dhole

Thank you for sharing ...