Is there any mechanism that allows forcing the use of a protected constructor in the receiver class?
A simple example:
template<typename T> class Factory; class Base { template<typename T> friend class Factory; protected: Base(); }; class Child : public Base { public: Child();
So, I want the Child class to only be created by the factory and ensure that all child classes that come from Base have a protected constructor.
Chris source share