Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 C++ 新手。在 xcode 5 中,这行代码抛出错误,“no matching function for call to max”。但我没有打电话给麦克斯!这是怎么回事?
springfact += clamp (0, ff.compression - 0.05, 0.12) * 3000; //no matching function for call to max
clamp()来电max()。从它的文档中,clamp取最小值和最大值并“钳制”value它之间的参数,所以它很可能是这样实现的:
clamp()
max()
clamp
value
clamp(min_value,value,max_value) -> min(max(min_value,value),max_value)
错误消息将您指向您看到的行,因为clamp可能是作为宏实现的,但由于某种原因max未声明/定义。
max