Reputation: 23911
I am new to C++. In xcode 5, this line of code is throwing the error, "no matching function for call to max." But I'm not calling max! What's going on?
springfact += clamp (0, ff.compression - 0.05, 0.12) * 3000; //no matching function for call to max
Upvotes: 0
Views: 400
Reputation: 56883
clamp()
calls max()
. From its documentation, clamp
takes a minimum and a maximum value and "clamps" the value
parameter between it, so it most likely is implemented like this:
clamp(min_value,value,max_value) -> min(max(min_value,value),max_value)
The error message is pointing you to the line you see because clamp
is probably implemented as a macro but for some reason max
is not declared/defined.
Upvotes: 1