I have something like this in the code:
Essentially the first min() is a function that takes two arguments and returns the smaller one, and the second min() is a class member function that takes no arguments and returns a member variable. The code compiles and works fine under Cygwin. But VC 2010 comes back with this error:Code:... template <class T> const T& min ( const T& a, const T& b ) { return (a<b)?a:b; } ... class ... { ... double min(void){return(MinVal);}// MinVal is a (double type) member of the class ... } ...
Code:warning C4003: not enough actual parameters for macro 'min'
It seems that VC does not know I was trying to define a member function, instead it thinks I wanted to use the first min() incorrectly.What's going on? Please help! Thanks!





Reply With Quote
