Constraint - Derived Class must have a default Constructor

gareb

New Member
I want to Constraint that the Derived Class must have a Default Constructor.I am currently thinking it in a perverted way\[code\]template <typename Derived>class Base{ public: Base(){ } virtual ~Base(){ new Derived; }};\[/code\]Another idea comes to mind is to keep a pure virtual create() method with no arguments.But is there any other way ? Other than these two.I am thinking it in C++ way. But Is there any way to do this in PHP (I expect negetive answer LOL)
 
Back
Top