mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
Fixed a bug in BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST: a typo VOId -> VOID.
Fixed a bug in scope_exit.hpp: An extra trailing \ in a macro definition (compiled only when BOOST_NO_VARIADIC_MACROS is defined). Renamed LocalFunction and ScopeExit tests and examples from _err to _error. Updated LocalFunction docs. [SVN r77042]
This commit is contained in:
parent
ef0f82f62b
commit
d6cb9a9176
@ -21,16 +21,16 @@
|
|||||||
|
|
||||||
This library allows to wrap type expressions within round parenthesis so they can be passed to macros even when they contain commas.
|
This library allows to wrap type expressions within round parenthesis so they can be passed to macros even when they contain commas.
|
||||||
|
|
||||||
[import ../test/var_err.cpp]
|
[import ../test/var_error.cpp]
|
||||||
[import ../test/var.cpp]
|
[import ../test/var.cpp]
|
||||||
[import ../test/template.cpp]
|
[import ../test/template.cpp]
|
||||||
[import ../test/tmp_assert.cpp]
|
[import ../test/tmp_assert.cpp]
|
||||||
|
|
||||||
[section Motivation]
|
[section Motivation]
|
||||||
|
|
||||||
Consider the following macro which declares a variable named `var`/n/ with the specified /type/ (see also [@../../test/var_err.cpp =var_err.cpp=]):
|
Consider the following macro which declares a variable named `var`/n/ with the specified /type/ (see also [@../../test/var_error.cpp =var_error.cpp=]):
|
||||||
|
|
||||||
[var_err]
|
[var_error]
|
||||||
|
|
||||||
The first macro invocation works correctly declaring a variable named `var1` of type `int`.
|
The first macro invocation works correctly declaring a variable named `var1` of type `int`.
|
||||||
However, the second macro invocation fails generating a preprocessor error similar to the following:
|
However, the second macro invocation fails generating a preprocessor error similar to the following:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
import testing ;
|
import testing ;
|
||||||
|
|
||||||
compile-fail var_err.cpp ;
|
compile-fail var_error.cpp ;
|
||||||
run var.cpp ;
|
run var.cpp ;
|
||||||
run template.cpp ;
|
run template.cpp ;
|
||||||
run tmp_assert.cpp ;
|
run tmp_assert.cpp ;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
//[var_err
|
//[var_error
|
||||||
#define VAR(type, n) type var ## n
|
#define VAR(type, n) type var ## n
|
||||||
|
|
||||||
VAR( int, 1 ); // OK.
|
VAR( int, 1 ); // OK.
|
Loading…
x
Reference in New Issue
Block a user