|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r77057 - in trunk/libs/scope_exit: doc/html example test
From: lorcaminiti_at_[hidden]
Date: 2012-02-17 12:52:37
Author: lcaminiti
Date: 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
New Revision: 77057
URL: http://svn.boost.org/trac/boost/changeset/77057
Log:
Not compiling tests that require variadic macros on compilers for with BOOST_NO_VARIADIC_MACROS is defined.
Text files modified:
trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html | 2 +-
trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html | 2 +-
trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html | 2 +-
trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html | 2 +-
trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html | 2 +-
trunk/libs/scope_exit/doc/html/index.html | 2 +-
trunk/libs/scope_exit/example/scope_guard.cpp | 9 +++++++++
trunk/libs/scope_exit/example/try_catch.cpp | 9 +++++++++
trunk/libs/scope_exit/test/native.cpp | 20 ++++++++++----------
trunk/libs/scope_exit/test/native_const_error.cpp | 2 +-
trunk/libs/scope_exit/test/native_cv_error.cpp | 2 +-
trunk/libs/scope_exit/test/native_this.cpp | 2 +-
trunk/libs/scope_exit/test/native_tpl.cpp | 4 ++--
trunk/libs/scope_exit/test/tu_test.hpp | 12 +++++++++---
trunk/libs/scope_exit/test/world.cpp | 9 +++++++++
trunk/libs/scope_exit/test/world_checkpoint.cpp | 9 +++++++++
trunk/libs/scope_exit/test/world_checkpoint_all.cpp | 6 +++---
trunk/libs/scope_exit/test/world_lambda.cpp | 4 ++--
trunk/libs/scope_exit/test/world_this.cpp | 9 +++++++++
trunk/libs/scope_exit/test/world_tpl.cpp | 9 +++++++++
20 files changed, 89 insertions(+), 29 deletions(-)
Modified: trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html
==============================================================================
--- trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html (original)
+++ trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -33,7 +33,7 @@
</span>BOOST_SCOPE_EXIT(capture_list)</pre></div>
<div class="refsect1">
-<a name="id870482"></a><h2>Description</h2>
+<a name="id851413"></a><h2>Description</h2>
<p>The scope exit declaration schedules the execution of the scope exit body at the exit of the enclosing scope:</p>
<pre class="programlisting"> <span class="special">{</span> <span class="comment">// Some local scope.</span>
<span class="special">...</span>
Modified: trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html
==============================================================================
--- trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html (original)
+++ trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -33,7 +33,7 @@
</span>BOOST_SCOPE_EXIT_ALL(capture_list)</pre></div>
<div class="refsect1">
-<a name="id871573"></a><h2>Description</h2>
+<a name="id852504"></a><h2>Description</h2>
<p>This macro accepts a capture list starting with either <code class="computeroutput">&</code> or <code class="computeroutput">=</code> to capture all variables in scope by reference or value respectively (following the same syntax of C++11 lambdas). A part from that, this macro works like <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> (see <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> for more information).</p>
<pre class="programlisting"> <span class="special">{</span> <span class="comment">// Some local scope.</span>
<span class="special">...</span>
Modified: trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html
==============================================================================
--- trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html (original)
+++ trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -33,7 +33,7 @@
</span>BOOST_SCOPE_EXIT_CONFIG_NO_CPP11</pre></div>
<div class="refsect1">
-<a name="id872336"></a><h2>Description</h2>
+<a name="id853272"></a><h2>Description</h2>
<p>If programmers define this configuration macro, C++11 features will not be used even on C++11 compilers (only C++03 features will be used). By default this macro is not defined.</p>
<p><span class="bold"><strong>Note:</strong></span> This macro does not disable comma-separated capture lists on compilers that support variadic macros (programmers can simply use Boost.Preprocessor sequences if they do not wish to use comma-separated capture lists).</p>
<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code>, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_ALL.html" title="Macro BOOST_SCOPE_EXIT_ALL">BOOST_SCOPE_EXIT_ALL</a></code>, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a></code>. </p>
Modified: trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html
==============================================================================
--- trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html (original)
+++ trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -33,7 +33,7 @@
</span>BOOST_SCOPE_EXIT_END</pre></div>
<div class="refsect1">
-<a name="id872111"></a><h2>Description</h2>
+<a name="id853046"></a><h2>Description</h2>
<p>This macro must follow the closing curly bracket <code class="computeroutput">}</code> that ends the scope exit body:</p>
<pre class="programlisting"> <span class="special">{</span> <span class="comment">// Some local scope.</span>
<span class="special">...</span>
Modified: trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html
==============================================================================
--- trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html (original)
+++ trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -33,7 +33,7 @@
</span>BOOST_SCOPE_EXIT_TPL(capture_list)</pre></div>
<div class="refsect1">
-<a name="id871040"></a><h2>Description</h2>
+<a name="id851971"></a><h2>Description</h2>
<p>Various versions of the GCC compiler do not compile <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> inside function templates. As a workaround, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> should be used instead of <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> in these cases:</p>
<pre class="programlisting"> <span class="special">{</span> <span class="comment">// Some local scope.</span>
<span class="special">...</span>
Modified: trunk/libs/scope_exit/doc/html/index.html
==============================================================================
--- trunk/libs/scope_exit/doc/html/index.html (original)
+++ trunk/libs/scope_exit/doc/html/index.html 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -122,7 +122,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: February 14, 2012 at 16:13:19 GMT</small></p></td>
+<td align="left"><p><small>Last revised: February 16, 2012 at 23:59:31 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: trunk/libs/scope_exit/example/scope_guard.cpp
==============================================================================
--- trunk/libs/scope_exit/example/scope_guard.cpp (original)
+++ trunk/libs/scope_exit/example/scope_guard.cpp 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -6,6 +6,9 @@
// http://www.boost.org/LICENSE_1_0.txt)
// Home at http://www.boost.org/libs/scope_exit
+#include <boost/config.hpp>
+#ifndef BOOST_NO_VARIADIC_MACROS
+
#include <boost/scope_exit.hpp>
#include <map>
#include <string>
@@ -35,3 +38,9 @@
return 0;
}
+#else
+
+int main(void) { return 0; } // Trivial program.
+
+#endif
+
Modified: trunk/libs/scope_exit/example/try_catch.cpp
==============================================================================
--- trunk/libs/scope_exit/example/try_catch.cpp (original)
+++ trunk/libs/scope_exit/example/try_catch.cpp 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -6,6 +6,9 @@
// http://www.boost.org/LICENSE_1_0.txt)
// Home at http://www.boost.org/libs/scope_exit
+#include <boost/config.hpp>
+#ifndef BOOST_NO_VARIADIC_MACROS
+
#include <boost/scope_exit.hpp>
#include <iostream>
@@ -56,3 +59,9 @@
return 0;
}
+#else
+
+int main(void) { return 0; } // Trivial program.
+
+#endif
+
Modified: trunk/libs/scope_exit/test/native.cpp
==============================================================================
--- trunk/libs/scope_exit/test/native.cpp (original)
+++ trunk/libs/scope_exit/test/native.cpp 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -33,13 +33,13 @@
BOOST_CHECK( Holder<>::g_long == 3 );
} BOOST_SCOPE_EXIT_END
- BOOST_SCOPE_EXIT(i) {
+ BOOST_SCOPE_EXIT( (i) ) {
BOOST_CHECK( i == 0 );
BOOST_CHECK( Holder<>::g_long == 3 );
BOOST_CHECK( g_str == "try: g_str" );
} BOOST_SCOPE_EXIT_END
- BOOST_SCOPE_EXIT(&i) {
+ BOOST_SCOPE_EXIT( (&i) ) {
BOOST_CHECK( i == 3 );
BOOST_CHECK( Holder<>::g_long == 3 );
BOOST_CHECK( g_str == "try: g_str" );
@@ -49,12 +49,12 @@
g_str = "";
Holder<>::g_long = 1;
- BOOST_SCOPE_EXIT(&i) {
+ BOOST_SCOPE_EXIT( (&i) ) {
i = 1;
g_str = "g_str";
} BOOST_SCOPE_EXIT_END
- BOOST_SCOPE_EXIT(&i) {
+ BOOST_SCOPE_EXIT( (&i) ) {
try {
i = 2;
Holder<>::g_long = 2;
@@ -71,25 +71,25 @@
BOOST_CHECK( g_str == "g_str" );
BOOST_CHECK( i == 1 ); // Check that first declared is executed last.
- BOOST_SCOPE_EXIT(&i) {
+ BOOST_SCOPE_EXIT( (&i) ) {
BOOST_CHECK( i == 3 );
BOOST_CHECK( Holder<>::g_long == 3 );
BOOST_CHECK( g_str == "try: g_str" );
} BOOST_SCOPE_EXIT_END
- BOOST_SCOPE_EXIT(i) {
+ BOOST_SCOPE_EXIT( (i) ) {
BOOST_CHECK( i == 1 );
BOOST_CHECK( Holder<>::g_long == 3 );
BOOST_CHECK( g_str == "try: g_str" );
} BOOST_SCOPE_EXIT_END
try {
- BOOST_SCOPE_EXIT(&i) {
+ BOOST_SCOPE_EXIT( (&i) ) {
i = 3;
g_str = "try: g_str";
} BOOST_SCOPE_EXIT_END
- BOOST_SCOPE_EXIT(&i) {
+ BOOST_SCOPE_EXIT( (&i) ) {
i = 4;
Holder<>::g_long = 3;
} BOOST_SCOPE_EXIT_END
@@ -116,7 +116,7 @@
bool results[2] = {};
{
- BOOST_SCOPE_EXIT(&results, &pf, &rf) {
+ BOOST_SCOPE_EXIT( (&results) (&pf) (&rf) ) {
results[0] = pf();
results[1] = rf();
}
@@ -132,7 +132,7 @@
BOOST_CHECK( results[1] == true );
{
- BOOST_SCOPE_EXIT(&results, pf) {
+ BOOST_SCOPE_EXIT( (&results) (pf) ) {
results[0] = !pf();
results[1] = !pf();
pf = &foo2; // modify a copy
Modified: trunk/libs/scope_exit/test/native_const_error.cpp
==============================================================================
--- trunk/libs/scope_exit/test/native_const_error.cpp (original)
+++ trunk/libs/scope_exit/test/native_const_error.cpp 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -10,7 +10,7 @@
int main(void) {
int const i = 0;
- BOOST_SCOPE_EXIT(&i) {
+ BOOST_SCOPE_EXIT( (&i) ) {
i = 5;
} BOOST_SCOPE_EXIT_END
}
Modified: trunk/libs/scope_exit/test/native_cv_error.cpp
==============================================================================
--- trunk/libs/scope_exit/test/native_cv_error.cpp (original)
+++ trunk/libs/scope_exit/test/native_cv_error.cpp 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -13,7 +13,7 @@
int main(void) {
std::string const volatile s;
- BOOST_SCOPE_EXIT(&s) {
+ BOOST_SCOPE_EXIT( (&s) ) {
s = "";
} BOOST_SCOPE_EXIT_END
}
Modified: trunk/libs/scope_exit/test/native_this.cpp
==============================================================================
--- trunk/libs/scope_exit/test/native_this.cpp (original)
+++ trunk/libs/scope_exit/test/native_this.cpp 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -19,7 +19,7 @@
struct this_tester {
void check(void) {
int target;
- BOOST_SCOPE_EXIT(&target, this_) {
+ BOOST_SCOPE_EXIT( (&target) (this_) ) {
BOOST_CHECK( this_->value_ == target );
} BOOST_SCOPE_EXIT_END
#if !defined(BOOST_NO_LAMBDAS) && !defined(BOOST_SCOPE_EXIT_CONFIG_NO_CPP11)
Modified: trunk/libs/scope_exit/test/native_tpl.cpp
==============================================================================
--- trunk/libs/scope_exit/test/native_tpl.cpp (original)
+++ trunk/libs/scope_exit/test/native_tpl.cpp 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -29,7 +29,7 @@
type const remember(tval);
{
- BOOST_SCOPE_EXIT_TPL(&tval, &t, &tc, &tv, &tcv, &i) {
+ BOOST_SCOPE_EXIT_TPL( (&tval) (&t) (&tc) (&tv) (&tcv) (&i) ) {
tval = 1;
++t;
++tv;
@@ -52,7 +52,7 @@
Vector const remember(vval);
{
- BOOST_SCOPE_EXIT_TPL(&vval, &v, &vc) {
+ BOOST_SCOPE_EXIT_TPL( (&vval) (&v) (&vc) ) {
v.push_back(-Value);
vval.push_back(Value);
} BOOST_SCOPE_EXIT_END
Modified: trunk/libs/scope_exit/test/tu_test.hpp
==============================================================================
--- trunk/libs/scope_exit/test/tu_test.hpp (original)
+++ trunk/libs/scope_exit/test/tu_test.hpp 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -14,7 +14,9 @@
inline int inline_f(void) {
int i = 99;
{
- BOOST_SCOPE_EXIT(&i) { i = -1; } BOOST_SCOPE_EXIT_END
+ BOOST_SCOPE_EXIT( (&i) ) {
+ i = -1;
+ } BOOST_SCOPE_EXIT_END
}
return i;
}
@@ -23,14 +25,18 @@
template<class Int>
Int template_f(Int i) {
{
- BOOST_SCOPE_EXIT_TPL(&i) { ++i; } BOOST_SCOPE_EXIT_END
+ BOOST_SCOPE_EXIT_TPL( (&i) ) {
+ ++i;
+ } BOOST_SCOPE_EXIT_END
}
return i;
}
#else
inline int template_f(int i) {
{
- BOOST_SCOPE_EXIT(&i) { ++i; } BOOST_SCOPE_EXIT_END
+ BOOST_SCOPE_EXIT( (&i) ) {
+ ++i;
+ } BOOST_SCOPE_EXIT_END
}
return i;
}
Modified: trunk/libs/scope_exit/test/world.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world.cpp (original)
+++ trunk/libs/scope_exit/test/world.cpp 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -6,6 +6,9 @@
// http://www.boost.org/LICENSE_1_0.txt)
// Home at http://www.boost.org/libs/scope_exit
+#include <boost/config.hpp>
+#ifndef BOOST_NO_VARIADIC_MACROS
+
#include <boost/scope_exit.hpp>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
@@ -46,3 +49,9 @@
BOOST_CHECK( w.persons_.size() == 1 );
}
+#else
+
+int main(void) { return 0; } // Trivial test.
+
+#endif
+
Modified: trunk/libs/scope_exit/test/world_checkpoint.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_checkpoint.cpp (original)
+++ trunk/libs/scope_exit/test/world_checkpoint.cpp 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -6,6 +6,9 @@
// http://www.boost.org/LICENSE_1_0.txt)
// Home at http://www.boost.org/libs/scope_exit
+#include <boost/config.hpp>
+#ifndef BOOST_NO_VARIADIC_MACROS
+
#include <boost/scope_exit.hpp>
#include <boost/foreach.hpp>
#include <boost/typeof/typeof.hpp>
@@ -107,3 +110,9 @@
BOOST_CHECK( oss.str() == "world(3, { person(1, 2), person(2, 2), })" );
}
+#else
+
+int main(void) { return 0; } // Trivial test.
+
+#endif
+
Modified: trunk/libs/scope_exit/test/world_checkpoint_all.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_checkpoint_all.cpp (original)
+++ trunk/libs/scope_exit/test/world_checkpoint_all.cpp 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -7,7 +7,7 @@
// Home at http://www.boost.org/libs/scope_exit
#include <boost/config.hpp>
-#ifndef BOOST_NO_LAMBDAS
+#if !defined(BOOST_NO_LAMBDAS) && !defined(BOOST_NO_VARIADIC_MACROS)
#include <boost/scope_exit.hpp>
#include <boost/foreach.hpp>
@@ -110,9 +110,9 @@
BOOST_CHECK( oss.str() == "world(3, { person(1, 2), person(2, 2), })" );
}
-#else // No lambdas (trivial test).
+#else
-int main(void) { return 0; }
+int main(void) { return 0; } // Trivial test.
#endif
Modified: trunk/libs/scope_exit/test/world_lambda.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_lambda.cpp (original)
+++ trunk/libs/scope_exit/test/world_lambda.cpp 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -51,9 +51,9 @@
BOOST_CHECK( w.persons_.size() == 1 );
}
-#else // No lambdas (trivial test).
+#else
-int main(void) { return 0; }
+int main(void) { return 0; } // Trivial test.
#endif
Modified: trunk/libs/scope_exit/test/world_this.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_this.cpp (original)
+++ trunk/libs/scope_exit/test/world_this.cpp 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -6,6 +6,9 @@
// http://www.boost.org/LICENSE_1_0.txt)
// Home at http://www.boost.org/libs/scope_exit
+#include <boost/config.hpp>
+#ifndef BOOST_NO_VARIADIC_MACROS
+
#include <boost/scope_exit.hpp>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
@@ -54,3 +57,9 @@
BOOST_CHECK( w.persons_.size() == 1 );
}
+#else
+
+int main(void) { return 0; } // Trivial test.
+
+#endif
+
Modified: trunk/libs/scope_exit/test/world_tpl.cpp
==============================================================================
--- trunk/libs/scope_exit/test/world_tpl.cpp (original)
+++ trunk/libs/scope_exit/test/world_tpl.cpp 2012-02-17 12:52:33 EST (Fri, 17 Feb 2012)
@@ -6,6 +6,9 @@
// http://www.boost.org/LICENSE_1_0.txt)
// Home at http://www.boost.org/libs/scope_exit
+#include <boost/config.hpp>
+#ifndef BOOST_NO_VARIADIC_MACROS
+
#include <boost/scope_exit.hpp>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/vector.hpp>
@@ -47,3 +50,9 @@
BOOST_CHECK( w.persons_.size() == 1 );
}
+#else
+
+int main(void) { return 0; } // Trivial test.
+
+#endif
+
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