Boost logo

Boost Users :

From: Jeff Foster (jfoster_at_[hidden])
Date: 2008-01-07 12:31:05


> -----Original Message-----
> From: boost-users-bounces_at_[hidden]
> [mailto:boost-users-bounces_at_[hidden]] On Behalf Of
> Steven Watanabe
> Sent: 07 January 2008 17:26
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users]MSVC2005/icc10.1 boost::date_time
> std::max 1.34.1
>
> AMDG
>
> Hicham Mouline <hicham <at> mouline.org> 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 <boost/date_time/posix_time/posix_time.hpp>
> > 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_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net