I have a type defined using typedef unsigned int value_t; and a function
value_t find_minimal_value(...) {
...
if(...) return numeric_limits<value_t>::max;
...
}
Compiler refuses to compile it, saying: invalid conversion from ‘int (*)()noexcept (true)’ to ‘value_t {aka int}’.
What does it mean? Looking into the numeric_limits class, the min() function should return a variable of the type passed to it via template typename, so value_t in this case. So why the code doesn't compile?
std::numeric_limits<T>::max()is a function.