求教一个模板类成员函数的有关问题
求教一个模板类成员函数的问题
类模板定义如下:
template<class RallT>
class NewtonRaphsonFunction {
public:
typedef RallT (*RallFunctionType)(const Array1d<RallT>& a); // Type for f_i(a)
// Construct from built-in function
NewtonRaphsonFunction(RallFunctionType fp = 0) : f_i(fp) {}
//下面这个函数编译时报错,错误为:error C2143: 语法错误 : 缺少“;”(在“<”的前面)
// Evaluate f_i(a)
TaylorCoefficient1d<RallT::EltT> operator()(const Array1d<RallT>& a) const {
return reform(f_i(a));
}
private:
RallFunctionType f_i;
};
其中的成员函数operator()无法通过编译,见类体内的注释,求教大家,谢谢了
------解决方案--------------------
是没有找到 TaylorCoefficient1d 的定义吧
类模板定义如下:
template<class RallT>
class NewtonRaphsonFunction {
public:
typedef RallT (*RallFunctionType)(const Array1d<RallT>& a); // Type for f_i(a)
// Construct from built-in function
NewtonRaphsonFunction(RallFunctionType fp = 0) : f_i(fp) {}
//下面这个函数编译时报错,错误为:error C2143: 语法错误 : 缺少“;”(在“<”的前面)
// Evaluate f_i(a)
TaylorCoefficient1d<RallT::EltT> operator()(const Array1d<RallT>& a) const {
return reform(f_i(a));
}
private:
RallFunctionType f_i;
};
其中的成员函数operator()无法通过编译,见类体内的注释,求教大家,谢谢了
------解决方案--------------------
是没有找到 TaylorCoefficient1d 的定义吧