|
Boost Users : |
From: Chris Russell (cdr_at_[hidden])
Date: 2002-10-17 08:58:01
Thank you.
<richard_cox_at_[hidden]> wrote in message
news:5D0C92E65C29D311A24D0090273C216804A9716E_at_BRKXMTCH02_b...
> On 17 October 2002 09:14, Chris Russell [mailto:cdr_at_[hidden]] wrote:
> >
> > I'm confused. Using MS Visual Studio 6.0 w/the Intel 6.0
> > compiler (or the
> > native VC compiler for that matter) the min and max macros
> > are defined in
> > the MS header WINDEF.H. It seems that config.hpp #undef's
> > these (although I
> > haven't figured out where or why yet). My environment seems
> > to be perfectly
> > happy using std::min/std::max. But what of all these
> > MS-defined macros that
> > use the undecorated min/max? I really don't want to go
> > chasing these down in
> > the MS + third-party headers if I can avoid it. Will someone
> > please explain
> > to me what's going on with config.hpp?
>
> There is nothing in windows.h that uses min & max. In fact if you define
> NOMINMAX *before* you include windows.h they will not be defined.
>
> > --- simple example ---
> >
> > #include <windows.h>
> > #include <boost/config.hpp>
> > #if defined(min)
> > #pragma message "min is defined"
> > #else
> > #pragma message "min not defined"
> > #endif
> > #if defined(max)
> > #pragma message "max is defined"
> > #else
> > #pragma message "max not defined"
> > #endif
> > int main(int argc, char* argv[])
> > {
> > int a = 10, b = 20; int c = min(a,b); int d = max(a,b);
> > return 0;
> > }
>
> You either need:
>
> using std::min;
> using std::max;
>
> or fully qualify those names...
>
> >
> > Deleting intermediate files and output files for project 'test - Win32
> > Debug'.
> > --------------------Configuration: test - Win32
> > Debug--------------------
> > Compiling...
> > StdAfx.cpp
> > test.cpp
> > . . . Boost configuring for Intel C++ compiler
> > min not defined
> > max not defined
> > L:\boost\test\test.cpp(24): error: identifier "min" is undefined
> > int c = min(a,b);
>
> ... hence this error, there is no ::min.
>
> > L:\boost\test\test.cpp(25): error: identifier "max" is undefined
> > int d = max(a,b);
> > ^
>
>
>
> Richard Cox
> Senior Software Developer
> Dell Technology Online
> All opinions and statements mine and do not in any way (unless expressly
> stated) imply anything at all on behalf of my employer
>
>
>
>
>
> Info: <http://www.boost.org>
> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
> Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
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