float App::fresnelReflectTerm(float etaPos, float etaNeg, float cos_theta_i)
{
float theta_i;
theta_i = acos(cos_theta_i);
...
这会生成“对重载函数的不明确调用错误”,并表示有四个选项:
float acos(float fValue)
double acos(double _X)
float acos(float _X)
long double acos(long double _X)
我怀疑问题在于第一个和第三个都采用浮点参数并返回浮点值。但是,有人可以给我一个提示,告诉我如何确定(我正在使用 Visual Studio)这四个函数的来源,以便我可以消除重复吗?或者也许只是给我一个关于如何解决这个问题的提示。
最佳答案
关于c++ - 错误: ambiguous call to overloaded function,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21894274/