Opened 10 years ago

Closed 10 years ago

Last modified 6 years ago

#7995 closed Bugs (fixed)

compile error in transform_width.hpp when the min macro is defined

Reported by: Richard Webb Owned by: Robert Ramey
Milestone: To Be Determined Component: serialization
Version: Boost 1.53.0 Severity: Problem
Keywords: Cc:

Description

When trying to compile some code that uses base64_from_binary in VC9 using 1.53, i got the errors:

boost\archive\iterators\transform_width.hpp(151) : error C2589: '(' : illegal token on right side of '::'

boost\archive\iterators\transform_width.hpp(151) : error C2059: syntax error : '::'

Which seems to be down to the 'min' macro being defined.

Changing line 151 to something like

unsigned int i = (std::min)(missing_bits, m_remaining_bits);

allows it to compile.

Change History (5)

comment:1 by Robert Ramey, 10 years ago

Resolution: fixed
Status: newclosed

Which compiler still defines "min" as a macro?

In any case, your adjustment seems harmless, so I'll roll it in

in reply to:  1 comment:2 by Richard Webb, 10 years ago

Replying to ramey:

Which compiler still defines "min" as a macro?

Visual Studio 2008, when including the windows headers without defining NOMINMAX first (I normally do, but in this case the code is using WTL, and that breaks if the macro isn't defined).

Thanks for fixing it in any case.

comment:3 by anonymous, 9 years ago

I have this problem too. boost 1.54 visual studio 2010 WTL 7.5

comment:4 by thomas.braun@…, 9 years ago

Please reopen this bug as this bug perists with boost 1.55 and Visual Studio 8 2005.

comment:5 by anonymous, 6 years ago

Bug persists with boost 1.55 and Visual Studio 2013.

Note: See TracTickets for help on using tickets.