如何实现
atot()
,使其根据类型使用 atof()
、atoi()
或 atol()
?
目前它对所有类型都使用 atof()
。template<typename T>
T Mtx<T>::atot(const char *s) const
{
return atof(s);
}
请注意速度非常重要。
T
选择函数吗? - Joseph Mansfield