MSVC2005/icc10.1 boost::date_time std::max 1.34.1
hello,
#include <iostream>
#include <algorithm>
int main()
{
const double d = std::max(5.0, 6.0);
return 0;
}
This works fine. <algorithm> is supposed to be included to use the max algorithm.
<algorithm> comes with VisualC++ headers, which intel uses.
The strange thing is that when adding
#include
AMDG
Hicham Mouline
#include <iostream> #include <algorithm> int main() { const double d = std::max(5.0, 6.0); return 0; } This works fine. The strange thing is that when adding #include
before or after <algorithm> Inclusing of that header seems somehow to damage "max".
max is defined as a macro by a microsoft header included from windows.h Use (std::max)(5.0, 6.0) In Christ, Steven Watanabe
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Steven Watanabe Sent: 07 January 2008 17:26 To: boost-users@lists.boost.org Subject: Re: [Boost-users]MSVC2005/icc10.1 boost::date_time std::max 1.34.1
AMDG
Hicham Mouline
writes: #include <iostream> #include <algorithm> int main() { const double d = std::max(5.0, 6.0); return 0; } This works fine. The strange thing is that when adding #include
before or after <algorithm> Inclusing of that header seems somehow to damage "max".
max is defined as a macro by a microsoft header included from windows.h
You can #define NOMINMAX To stop this behaviour
Use (std::max)(5.0, 6.0)
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Hicham Mouline
-
Jeff Foster
-
Steven Watanabe