From a9422b863d60670ca1e94315d9c6a98b5f523661 Mon Sep 17 00:00:00 2001 From: Eric Niebler <eric@boostpro.com> Date: Wed, 23 Jun 2004 04:49:48 +0000 Subject: [PATCH] remove std_min and std_max, update minmax coding guidelines [SVN r23162] --- lib_guide.htm | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib_guide.htm b/lib_guide.htm index 00c6113..979084c 100644 --- a/lib_guide.htm +++ b/lib_guide.htm @@ -305,12 +305,19 @@ If you want to call <code>std::min()</code> or <code>std::max()</code>:<br> <ul> <li> - Use <code>(std::min)(a,b)</code> if you do not require argument-dependent - look-up.</li> + If you do not require argument-dependent look-up, use <code>(std::min)(a,b)</code>. + </li> <li> - Use <code>boost::std_min(a,b)</code> if you do require argument-dependent look-up. - <code>boost::std_min()</code> delegates to <code>std::min()</code>.</li> - </ul> + If you do require argument-dependent look-up, you should:<br> + <ul> + <li><code>#include <boost/minmax.hpp></code></li> + <li>Use <code>BOOST_USING_STD_MIN();</code> to bring <code>std::min()</code> into + the current scope.</li> + <li>Use <code>min BOOST_PREVENT_MACRO_SUBSTITUTION (a,b);</code> to make an + argument-dependent call to <code>min(a,b)</code>.</li> + </ul> + </li> + </ul> </li> <li> If you want to call <code>std::numeric_limits<int>::max()</code>, use @@ -324,7 +331,7 @@ If you want to declare or define a function or a member function named <code>min</code> or <code>max</code>, then you must use the <code>BOOST_PREVENT_MACRO_SUBSTITUTION</code> macro. Instead of writing <code>int min() { return 0; }</code> you should write - <code>int min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; }</code>This is true + <code>int min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; }</code> This is true regardless if the function is a free (namespace scope) function, a member function or a static member function, and it applies for the function declaration as well as the function definition.<br> @@ -369,7 +376,7 @@ <td>If any build files.</td> </tr> <tr> - <td>doc</td> + <td><code>doc</code></td> <td>Documentation (HTML) files.</td> <td>If several doc files.</td> </tr>