class template without public constructor as member of another class template
问题 I have a class template Shape , which contains information about certain shapes (which can be three- or two-dimensional). I only want a few predefined shapes (cube, sphere and square) to be available. All these predefined shapes have the same properties (so the cube always has the same volume, and I only need to remember the properties of one cube). To inhibit someone from creating other Shape s, I made the constructor private : // Flag for the possible shapes enum class Tag { SPHERE, CUBE,