[serialization] and macro 'max' compiler warning on VC71

I've just tried to move to 1.32 and get the following warning: C:\boost\boost_1_32_0\boost\archive\basic_binary_oprimitive.hpp(101) : warning C4003: not enough actual parameters for macro 'max' which points to: assert( static_cast<std::size_t>(std::numeric_limits<std::streamsize>::max()) >= count ); Any suggestions on avoiding this with an MFC based project? Thanks, Jeff

I use MFC on a regular basis. What works best for me is to not mix boost and MFC headers in the same module. This requires a little bit of organization but I believe is simpler in the long run. Robert Ramey "Jeff Flinn" <TriumphSprint2000@hotmail.com> wrote in message news:cntc3l$7ia$1@sea.gmane.org... I've just tried to move to 1.32 and get the following warning: C:\boost\boost_1_32_0\boost\archive\basic_binary_oprimitive.hpp(101) : warning C4003: not enough actual parameters for macro 'max' which points to: assert( static_cast<std::size_t>(std::numeric_limits<std::streamsize>::max()) >= count ); Any suggestions on avoiding this with an MFC based project? Thanks, Jeff _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

"Robert Ramey" <ramey@rrsd.com> wrote in message news:cntdbc$bah$1@sea.gmane.org...
I use MFC on a regular basis. What works best for me is to not mix boost and MFC headers in the same module. This requires a little bit of organization but I believe is simpler in the long run.
Except when one is serializing views themselves.
Robert Ramey
"Jeff Flinn" <TriumphSprint2000@hotmail.com> wrote in message news:cntc3l$7ia$1@sea.gmane.org... I've just tried to move to 1.32 and get the following warning:
C:\boost\boost_1_32_0\boost\archive\basic_binary_oprimitive.hpp(101) : warning C4003: not enough actual parameters for macro 'max'
which points to:
assert(
static_cast<std::size_t>(std::numeric_limits<std::streamsize>::max()) >= count );
I seemed to remember related min/max discussions in the past that suggested surrounding the qualified function name in parens as shown below assert ( static_cast<std::size_t>((std::numeric_limits<std::streamsize>::max)()) >= count ); This appears to work in both binary_oprimitive line 101 and binary_iprimitive line 105 Thanks, Jeff

This is a problem with windows.h, it includes the min() and max() macros which can easily screw over c++. Define NOMINMAX before windows.h is included and the problem goes away. On Mon, 22 Nov 2004 14:56:26 -0500, Jeff Flinn <triumphsprint2000@hotmail.com> wrote:
"Robert Ramey" <ramey@rrsd.com> wrote in message news:cntdbc$bah$1@sea.gmane.org...
I use MFC on a regular basis. What works best for me is to not mix boost and MFC headers in the same module. This requires a little bit of organization but I believe is simpler in the long run.
Except when one is serializing views themselves.
Robert Ramey
"Jeff Flinn" <TriumphSprint2000@hotmail.com> wrote in message news:cntc3l$7ia$1@sea.gmane.org... I've just tried to move to 1.32 and get the following warning:
C:\boost\boost_1_32_0\boost\archive\basic_binary_oprimitive.hpp(101) : warning C4003: not enough actual parameters for macro 'max'
which points to:
assert(
static_cast<std::size_t>(std::numeric_limits<std::streamsize>::max()) >= count );
I seemed to remember related min/max discussions in the past that suggested surrounding the qualified function name in parens as shown below
assert ( static_cast<std::size_t>((std::numeric_limits<std::streamsize>::max)()) >= count );
This appears to work in both binary_oprimitive line 101 and binary_iprimitive line 105
Thanks, Jeff
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- Cory Nelson http://www.int64.org

"Cory Nelson" <phrosty@gmail.com> wrote in message news:9b1d0614041122133848c18839@mail.gmail.com...
This is a problem with windows.h, it includes the min() and max() macros which can easily screw over c++. Define NOMINMAX before windows.h is included and the problem goes away.
I've done that but still have the problem. Thanks, Jeff
On Mon, 22 Nov 2004 14:56:26 -0500, Jeff Flinn <triumphsprint2000@hotmail.com> wrote:
"Robert Ramey" <ramey@rrsd.com> wrote in message news:cntdbc$bah$1@sea.gmane.org...
I use MFC on a regular basis. What works best for me is to not mix
boost
and MFC headers in the same module. This requires a little bit of organization but I believe is simpler in the long run.
Except when one is serializing views themselves.
Robert Ramey
"Jeff Flinn" <TriumphSprint2000@hotmail.com> wrote in message news:cntc3l$7ia$1@sea.gmane.org... I've just tried to move to 1.32 and get the following warning:
C:\boost\boost_1_32_0\boost\archive\basic_binary_oprimitive.hpp(101) : warning C4003: not enough actual parameters for macro 'max'
which points to:
assert(
static_cast<std::size_t>(std::numeric_limits<std::streamsize>::max()) = count );
I seemed to remember related min/max discussions in the past that suggested surrounding the qualified function name in parens as shown below
assert ( static_cast<std::size_t>((std::numeric_limits<std::streamsize>::max)()) = count );
This appears to work in both binary_oprimitive line 101 and binary_iprimitive line 105
Thanks, Jeff
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- Cory Nelson http://www.int64.org _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (3)
-
Cory Nelson
-
Jeff Flinn
-
Robert Ramey