The template & lt; The class Type & gt;
Type CurveDataModel: : stringToNum (const STD: : string& STR)
{
STD: : istringstream iss (STR);
Type num.
Iss & gt;> Num.
return num;
}
X=stringToNum
Y=stringToNum
Z=stringToNum
NumberPrecision=Max (numberPrecision, Max (getNumberPrecision (x_string),
Max (getNumberPrecision (y_string), getNumberPrecision (z_string))));
This is a small part of the code, there are several mistakes, to collapse!
CodePudding user response:
What isX=stringToNum
Y=stringToNum
Z=stringToNum
Change so that is not an error! It is the metaphysics...
CodePudding user response:
Not a metaphysics, template function was so,Because the template function is not a function, but a template, only depending on the template parameters can identify a specific function
For example,
Template
T Max (T, a, T, b);
So max
If you specify a, b type, which can be deduced T
You can directly to the Max (a, b), if it cannot be derived must specify the template parameter type
So call
Max