Open vigsterkr opened 10 years ago
@vigsterkr what is wrong with having two inits with different parameters? The following code doesn't show any error/warning on gcc
#include <iostream>
using namespace std;
class Preprocessor
{
public:
Preprocessor()
{
cout << "Preprocessor constructor called" << endl;
}
virtual bool init(int a) = 0;
virtual ~Preprocessor()
{
cout << "Preprocessor destructor called" << endl;
}
};
template <class T> class FeatureSelection : public Preprocessor
{
public:
FeatureSelection<T>()
{
init();
init(10);
cout << "FeatureSelection constructor called" << endl;
}
virtual bool init(int a)
{
cout << "overridden init()" << endl;
}
virtual ~FeatureSelection<T>()
{
cout << "FeatureSelection destructor called" << endl;
}
private:
void init()
{
cout << "private init()" << endl;
}
};
int main()
{
cout << "Hello World" << endl;
FeatureSelection<double> *fs = new FeatureSelection<double>();
delete fs;
return 0;
}