Today I wrote a class. One of the Methods uses the default parameter and the error "Default argument given of parameter" is returned.
The Class header file declaration is as follows:
void train(std::vector<std::vector<double> >& trainSet, std::vector<int>& labels, const std::string model, double lrate, std::vector<double>& w , double& b, int maxiter, double delt = 0.0000001 );
The implementation code is as follows:
<pre name="code" class="cpp">void perceptron::train(std::vector<std::vector<double> >& trainSet, std::vector<int>& labels, const std::string model, double lrate, std::vector<double>& w , double& b, int maxiter, double delt=0.000001 ){ ....}
It is only known after online query,
Functions with default values cannot have values in the parameters during implementation..
Remove the default parameters in the Implementation Code as follows:
void perceptron::train(std::vector<std::vector<double> >& trainSet, std::vector<int>& labels, const std::string model, double lrate, std::vector<double>& w , double& b, int maxiter, double delt ){ ....}
This error does not occur. Record it.
Default argument given of Parameter