Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2002-01-07 07:05:37

The following bug report came my way, however
the issue predates the new config, which just
copied what we had previously here.
Can anyone remember why we have the min/max
behaviour that we have with VC6?

- John Maddock

-------------Forwarded Message-----------------

From: INTERNET:noreply_at_[hidden], INTERNET:noreply_at_[hidden]
To: [unknown], INTERNET:noreply_at_[hidden]
Date: 06/01/02 13:58 PM

RE: [ boost-Bugs-495495 ] Visual C++ and min/max specialization

Bugs item #495495, was opened at 2001-12-20 09:11
You can respond by visiting:

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: John Maddock (johnmaddock)
Summary: Visual C++ and min/max specialization

Initial Comment:
Boost's default configuration for Visual C++ 6.0
exposes some problems with the Visual C++ compiler
when using min/max. (Boost version 1.26)

I had setup a header to expose min/max template
functions instead of using the min/max macros in

using std::min;
using std::max;

The same header included boost header

The problem: If I mixed types in the min/max call,
Visual C++ would always call the specialized min/max
function for the long type given in suffix.hpp.


float y = min( (double)a, (float)b );
    //call boost's min(long,long)!!!!

I'm not sure why you have the specialization of
min/max for long types in suffix.hpp, but from my
perspective its more dangerous than it is useful.

Without this template specialization, at least the
compiler tells me that no version of min matches min


>Comment By: Jens Maurer (jmaurer)
Date: 2002-01-06 05:57

Logged In: YES

First, it's not a specialization, it's an overload.

It looks like some MSVC headers or program expect the
min/max macro behaviour, where you can mix types freely.

I agree it changes semantics silently. I've forwarded this
to John Maddock, our config guy.


You can respond by visiting:

----------------------- Internet Header --------------------------------
Sender: nobody_at_[hidden]
Received: from ( [])
        by (8.9.3/8.9.3/SUN-1.12) with ESMTP id IAA15646
        for <John_Maddock_at_[hidden]>; Sun, 6 Jan 2002 08:57:57 -0500 (EST)
Received: from ([]
        by with esmtp (Exim 3.22 #1 (Debian))
        id 16NDoB-0003Hx-00; Sun, 06 Jan 2002 05:57:55 -0800
Received: from nobody by with local (Exim 3.22 #1 (Debian))
        id 16NDoB-0000m3-00; Sun, 06 Jan 2002 05:57:55 -0800
To: noreply_at_[hidden]
From: noreply_at_[hidden]
Subject: [ boost-Bugs-495495 ] Visual C++ and min/max specialization
Message-Id: <E16NDoB-0000m3-00_at_[hidden]>
Sender: nobody <nobody_at_[hidden]>
Date: Sun, 06 Jan 2002 05:57:55 -0800

Boost list run by bdawes at, gregod at, cpdaniel at, john at