Boost C++ Libraries: Ticket #29: Visual C++ and min/max specialization https://svn.boost.org/trac10/ticket/29 <pre class="wiki">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 stdlib.h: using std::min; using std::max; The same header included boost header (boost/operatiors.hpp) 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. E.g. 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 (double,float). </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/29 Trac 1.4.3 jmaurer Sun, 06 Jan 2002 13:57:55 GMT <link>https://svn.boost.org/trac10/ticket/29#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/29#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=53943 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. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>jmaurer</dc:creator> <pubDate>Sun, 03 Mar 2002 10:04:09 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/29#comment:2 https://svn.boost.org/trac10/ticket/29#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=53943 Temporarily fixed by adding a "long double" overload, until proven that the "long" overload is actually never needed. (Then all overloads can be removed together.) </pre> Ticket