j****i 发帖数: 305 | 1 I'm using clapack where some macros like min, max, abs etc are defined. When
I include the f2c.h and clapack.h headers the gcc compiler complains that
the std::numeric_limits::max() in my own code does not have enough
number of arguments for the macro "max". The compiler uses the "max" defined
in the f2c.h instead of using the one in std, even though I specified the
namespace and class numeric_limits when I call the max().
I "fixed" this problem by removing all the calls to std::numeric_ | a**********s 发帖数: 588 | 2 No expert, but did you try this:
(numeric_limits::max)();
?? | j****i 发帖数: 305 | 3 I don't have access to the computer I was testing lapack. I can try what you
suggested and I think it might work, since
max has no "(" followed.
But what about the complex class in c++, which I cannot and do not want to
change. In that class the std::abs() function is used. There got to be a way
to solve this systematically.
【在 a**********s 的大作中提到】 : No expert, but did you try this: : (numeric_limits::max)(); : ??
| X****r 发帖数: 3557 | 4 If you don't use these macros in your own code, just undefine them before
including header files that contains functions with the same name.
you
to
way
【在 j****i 的大作中提到】 : I don't have access to the computer I was testing lapack. I can try what you : suggested and I think it might work, since : max has no "(" followed. : But what about the complex class in c++, which I cannot and do not want to : change. In that class the std::abs() function is used. There got to be a way : to solve this systematically.
|
|