In the sample:
#include
using namespace std;
class B
{
public:
virtual void pvf() = 0;
};
template
class D : public B
{
p
Consider that D
will be responsible for default-constructing string data
, and that D
doesn't have any such member. Clearly there is no way to use the same emitted code in each case.
However, if your default constructor doesn't do anything (in either version here), just omit it and allow the compiler to do the work.