Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71029 - in trunk/libs/config/doc: . html html/boost_config
From: john_at_[hidden]
Date: 2011-04-06 06:52:23


Author: johnmaddock
Date: 2011-04-06 06:52:22 EDT (Wed, 06 Apr 2011)
New Revision: 71029
URL: http://svn.boost.org/trac/boost/changeset/71029

Log:
Add BOOST_PREVENT_MACRO_SUBSTITUTION and regenerate docs.
Fixes #5349.
Text files modified:
   trunk/libs/config/doc/html/boost_config/boost_macro_reference.html | 24 ++++++++++++++++++++++++
   trunk/libs/config/doc/html/index.html | 4 ++--
   trunk/libs/config/doc/macro_reference.qbk | 11 +++++++++++
   3 files changed, 37 insertions(+), 2 deletions(-)

Modified: trunk/libs/config/doc/html/boost_config/boost_macro_reference.html
==============================================================================
--- trunk/libs/config/doc/html/boost_config/boost_macro_reference.html (original)
+++ trunk/libs/config/doc/html/boost_config/boost_macro_reference.html 2011-04-06 06:52:22 EDT (Wed, 06 Apr 2011)
@@ -2896,6 +2896,30 @@
 <tr>
 <td>
                 <p>
+ <code class="computeroutput"><span class="identifier">BOOST_PREVENT_MACRO_SUBSTITUTION</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Sometimes you have a function name with the same name as a C macro,
+ for example "min" and "max" member functions,
+ in which case one can prevent the function being expanded as a
+ macro using:
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">someclass</span><span class="special">.</span><span class="identifier">min</span> <span class="identifier">BOOST_PREVENT_MACRO_SUBSTITUTION</span><span class="special">(</span><span class="identifier">arg1</span><span class="special">,</span> <span class="identifier">arg2</span><span class="special">);</span>
+</pre>
+<p>
+ The following also works in most, but not all, contexts:
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">(</span><span class="identifier">someclass</span><span class="special">.</span><span class="identifier">max</span><span class="special">)(</span><span class="identifier">arg1</span><span class="special">,</span> <span class="identifier">arg2</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
                   <code class="computeroutput"><span class="identifier">BOOST_DEDUCED_TYPENAME</span></code>
                 </p>
               </td>

Modified: trunk/libs/config/doc/html/index.html
==============================================================================
--- trunk/libs/config/doc/html/index.html (original)
+++ trunk/libs/config/doc/html/index.html 2011-04-06 06:52:22 EDT (Wed, 06 Apr 2011)
@@ -28,7 +28,7 @@
 </h3></div></div></div>
 <div><p class="copyright">Copyright &#169; 2001 -2007 Beman Dawes, Vesa Karvonen, John Maddock</p></div>
 <div><div class="legalnotice">
-<a name="id1029206"></a><p>
+<a name="id1006373"></a><p>
         Distributed under the Boost Software License, Version 1.0. (See accompanying
         file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
       </p>
@@ -946,7 +946,7 @@
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: March 15, 2011 at 13:01:43 GMT</small></p></td>
+<td align="left"><p><small>Last revised: April 06, 2011 at 10:49:30 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: trunk/libs/config/doc/macro_reference.qbk
==============================================================================
--- trunk/libs/config/doc/macro_reference.qbk (original)
+++ trunk/libs/config/doc/macro_reference.qbk 2011-04-06 06:52:22 EDT (Wed, 06 Apr 2011)
@@ -668,6 +668,17 @@
 
 [*Note]: the ultimate source of documentation for this macro is in [@../../../../boost/detail/workaround.hpp boost/detail/workaround.hpp].
 ]]
+[[`BOOST_PREVENT_MACRO_SUBSTITUTION`][
+Sometimes you have a function name with the same name as a C macro, for example "min" and "max"
+member functions, in which case one can prevent the function being expanded as a macro using:
+``
+someclass.min BOOST_PREVENT_MACRO_SUBSTITUTION(arg1, arg2);
+``
+The following also works in most, but not all, contexts:
+``
+(someclass.max)(arg1, arg2);
+``
+]]
 [[`BOOST_DEDUCED_TYPENAME`][
 Some compilers don't support the use of typename for dependent types in deduced
 contexts. This macro expands to nothing on those compilers, and typename


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk