Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78564 - in branches/release: . boost boost/functional boost/functional/overloaded_function boost/functional/overloaded_function/detail boost/local_function boost/local_function/aux_ boost/local_function/aux_/macro boost/local_function/aux_/macro/code_ boost/local_function/detail/preprocessor boost/local_function/detail/preprocessor/keyword/facility boost/utility libs libs/functional libs/functional/overloaded_function libs/functional/overloaded_function/doc libs/functional/overloaded_function/doc/html libs/functional/overloaded_function/doc/html/boost libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction libs/functional/overloaded_function/test libs/local_function libs/local_function/doc libs/local_function/doc/html libs/local_function/doc/html/boost_localfunction libs/local_function/example libs/local_function/test libs/scope_exit libs/scope_exit/doc libs/scope_exit/doc/html libs/scope_exit/doc/html/scope_exit libs/scope_exit/example libs/scope_exit/test libs/utility libs/utility/identity_type libs/utility/identity_type/doc libs/utility/identity_type/doc/html libs/utility/identity_type/test status
From: lorcaminiti_at_[hidden]
Date: 2012-05-23 21:35:26


Author: lcaminiti
Date: 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
New Revision: 78564
URL: http://svn.boost.org/trac/boost/changeset/78564

Log:
Merged ScopeExit (improved), LocalFunction (new), Functional/OverloadedFunction (new), and Utility/IdentityType (new) from trunk into release branch.
Added:
   branches/release/boost/functional/overloaded_function/ (props changed)
      - copied from r77025, /trunk/boost/functional/overloaded_function/
   branches/release/boost/functional/overloaded_function.hpp (contents, props changed)
      - copied, changed from r77025, /trunk/boost/functional/overloaded_function.hpp
   branches/release/boost/local_function/ (props changed)
      - copied from r77024, /trunk/boost/local_function/
   branches/release/boost/local_function.hpp (contents, props changed)
      - copied, changed from r77024, /trunk/boost/local_function.hpp
   branches/release/boost/utility/identity_type.hpp (contents, props changed)
      - copied, changed from r77024, /trunk/boost/utility/identity_type.hpp
   branches/release/libs/functional/overloaded_function/ (props changed)
      - copied from r77027, /trunk/libs/functional/overloaded_function/
   branches/release/libs/functional/overloaded_function/test/functor.cpp
      - copied, changed from r77586, /trunk/libs/functional/overloaded_function/test/functor.cpp
   branches/release/libs/functional/overloaded_function/test/identity.hpp
      - copied, changed from r77586, /trunk/libs/functional/overloaded_function/test/identity.hpp
   branches/release/libs/functional/overloaded_function/test/make_call.cpp
      - copied, changed from r77586, /trunk/libs/functional/overloaded_function/test/make_call.cpp
   branches/release/libs/functional/overloaded_function/test/make_decl.cpp
      - copied, changed from r77586, /trunk/libs/functional/overloaded_function/test/make_decl.cpp
   branches/release/libs/local_function/ (props changed)
      - copied from r77018, /trunk/libs/local_function/
   branches/release/libs/local_function/doc/ (props changed)
      - copied from r77026, /trunk/libs/local_function/doc/
   branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html
      - copied, changed from r77930, /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html
   branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_ID.html
      - copied, changed from r77436, /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_ID.html
   branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_NAME_TPL.html
      - copied, changed from r77930, /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_NAME_TPL.html
   branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_TPL_ID.html
      - copied unchanged from r77971, /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_TPL_ID.html
   branches/release/libs/local_function/example/
      - copied from r77026, /trunk/libs/local_function/example/
   branches/release/libs/local_function/example/add_cxx11_lambda.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/example/add_cxx11_lambda.cpp
   branches/release/libs/local_function/example/const_block_error.cpp
      - copied unchanged from r77042, /trunk/libs/local_function/example/const_block_error.cpp
   branches/release/libs/local_function/example/const_block_error_cxx11_lambda.cpp
      - copied unchanged from r77971, /trunk/libs/local_function/example/const_block_error_cxx11_lambda.cpp
   branches/release/libs/local_function/example/expensive_copy_cxx11_lambda.cpp
      - copied, changed from r77830, /trunk/libs/local_function/example/expensive_copy_cxx11_lambda.cpp
   branches/release/libs/local_function/example/gcc_cxx11_lambda.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/example/gcc_cxx11_lambda.cpp
   branches/release/libs/local_function/example/noncopyable_cxx11_lambda_error.cpp
      - copied, changed from r77830, /trunk/libs/local_function/example/noncopyable_cxx11_lambda_error.cpp
   branches/release/libs/local_function/example/profile_cxx11_lambda.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/example/profile_cxx11_lambda.cpp
   branches/release/libs/local_function/example/profile_gcc_cxx11_debug.png
      - copied unchanged from r77436, /trunk/libs/local_function/example/profile_gcc_cxx11_debug.png
   branches/release/libs/local_function/example/profile_gcc_cxx11_release.png
      - copied unchanged from r77436, /trunk/libs/local_function/example/profile_gcc_cxx11_release.png
   branches/release/libs/local_function/example/profile_legend_cxx11_lambda.png
      - copied unchanged from r77830, /trunk/libs/local_function/example/profile_legend_cxx11_lambda.png
   branches/release/libs/local_function/index.html
      - copied unchanged from r77026, /trunk/libs/local_function/index.html
   branches/release/libs/local_function/test/
      - copied from r77026, /trunk/libs/local_function/test/
   branches/release/libs/local_function/test/add_classifiers_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/add_classifiers_seq.cpp
   branches/release/libs/local_function/test/add_classifiers_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/add_classifiers_seq_nova.cpp
   branches/release/libs/local_function/test/add_default_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/add_default_seq.cpp
   branches/release/libs/local_function/test/add_default_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/add_default_seq_nova.cpp
   branches/release/libs/local_function/test/add_except_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/add_except_seq.cpp
   branches/release/libs/local_function/test/add_except_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/add_except_seq_nova.cpp
   branches/release/libs/local_function/test/add_inline_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/add_inline_seq.cpp
   branches/release/libs/local_function/test/add_inline_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/add_inline_seq_nova.cpp
   branches/release/libs/local_function/test/add_params_only.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/add_params_only.cpp
   branches/release/libs/local_function/test/add_params_only_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/add_params_only_seq.cpp
   branches/release/libs/local_function/test/add_params_only_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/add_params_only_seq_nova.cpp
   branches/release/libs/local_function/test/add_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/add_seq.cpp
   branches/release/libs/local_function/test/add_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/add_seq_nova.cpp
   branches/release/libs/local_function/test/add_template_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/add_template_seq.cpp
   branches/release/libs/local_function/test/add_template_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/add_template_seq_nova.cpp
   branches/release/libs/local_function/test/add_this_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/add_this_seq.cpp
   branches/release/libs/local_function/test/add_this_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/add_this_seq_nova.cpp
   branches/release/libs/local_function/test/add_typed_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/add_typed_seq.cpp
   branches/release/libs/local_function/test/add_typed_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/add_typed_seq_nova.cpp
   branches/release/libs/local_function/test/add_with_default_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/add_with_default_seq.cpp
   branches/release/libs/local_function/test/add_with_default_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/add_with_default_seq_nova.cpp
   branches/release/libs/local_function/test/all_decl.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/all_decl.cpp
   branches/release/libs/local_function/test/all_decl_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/all_decl_seq.cpp
   branches/release/libs/local_function/test/all_decl_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/all_decl_seq_nova.cpp
   branches/release/libs/local_function/test/factorial_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/factorial_seq.cpp
   branches/release/libs/local_function/test/factorial_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/factorial_seq_nova.cpp
   branches/release/libs/local_function/test/goto_error.cpp
      - copied, changed from r77042, /trunk/libs/local_function/test/goto_error.cpp
   branches/release/libs/local_function/test/goto_error_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/goto_error_seq.cpp
   branches/release/libs/local_function/test/goto_error_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/goto_error_seq_nova.cpp
   branches/release/libs/local_function/test/goto_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/goto_seq.cpp
   branches/release/libs/local_function/test/goto_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/goto_seq_nova.cpp
   branches/release/libs/local_function/test/macro_commas_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/macro_commas_seq.cpp
   branches/release/libs/local_function/test/macro_commas_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/macro_commas_seq_nova.cpp
   branches/release/libs/local_function/test/nesting_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/nesting_seq.cpp
   branches/release/libs/local_function/test/nesting_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/nesting_seq_nova.cpp
   branches/release/libs/local_function/test/nova.hpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/nova.hpp
   branches/release/libs/local_function/test/operator_error.cpp
      - copied, changed from r77042, /trunk/libs/local_function/test/operator_error.cpp
   branches/release/libs/local_function/test/operator_error_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/operator_error_seq.cpp
   branches/release/libs/local_function/test/operator_error_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/operator_error_seq_nova.cpp
   branches/release/libs/local_function/test/operator_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/operator_seq.cpp
   branches/release/libs/local_function/test/operator_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/operator_seq_nova.cpp
   branches/release/libs/local_function/test/overload_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/overload_seq.cpp
   branches/release/libs/local_function/test/overload_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/overload_seq_nova.cpp
   branches/release/libs/local_function/test/return_assign_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/return_assign_seq.cpp
   branches/release/libs/local_function/test/return_assign_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/return_assign_seq_nova.cpp
   branches/release/libs/local_function/test/return_derivative_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/return_derivative_seq.cpp
   branches/release/libs/local_function/test/return_derivative_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/return_derivative_seq_nova.cpp
   branches/release/libs/local_function/test/return_inc_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/return_inc_seq.cpp
   branches/release/libs/local_function/test/return_inc_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/return_inc_seq_nova.cpp
   branches/release/libs/local_function/test/return_setget_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/return_setget_seq.cpp
   branches/release/libs/local_function/test/return_setget_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/return_setget_seq_nova.cpp
   branches/release/libs/local_function/test/return_this_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/return_this_seq.cpp
   branches/release/libs/local_function/test/return_this_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/return_this_seq_nova.cpp
   branches/release/libs/local_function/test/same_line.cpp
      - copied, changed from r77411, /trunk/libs/local_function/test/same_line.cpp
   branches/release/libs/local_function/test/same_line_seq.cpp
      - copied, changed from r77411, /trunk/libs/local_function/test/same_line_seq.cpp
   branches/release/libs/local_function/test/same_line_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/same_line_seq_nova.cpp
   branches/release/libs/local_function/test/ten_void_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/ten_void_nova.cpp
   branches/release/libs/local_function/test/transform_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/transform_seq.cpp
   branches/release/libs/local_function/test/transform_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/transform_seq_nova.cpp
   branches/release/libs/local_function/test/typeof_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/typeof_seq.cpp
   branches/release/libs/local_function/test/typeof_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/typeof_seq_nova.cpp
   branches/release/libs/local_function/test/typeof_template_seq.cpp
      - copied, changed from r77097, /trunk/libs/local_function/test/typeof_template_seq.cpp
   branches/release/libs/local_function/test/typeof_template_seq_nova.cpp
      - copied unchanged from r77830, /trunk/libs/local_function/test/typeof_template_seq_nova.cpp
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html
      - copied, changed from r77042, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html
      - copied, changed from r77042, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html
      - copied, changed from r77042, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS.html
      - copied, changed from r77930, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS.html
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDA_IMPL.html
      - copied, changed from r77436, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDA_IMPL.html
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html
      - copied, changed from r77042, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html
      - copied, changed from r77042, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL_ID.html
      - copied, changed from r77930, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL_ID.html
   branches/release/libs/scope_exit/doc/html/reference.html
      - copied, changed from r77042, /trunk/libs/scope_exit/doc/html/reference.html
   branches/release/libs/scope_exit/doc/html/scope_exit/Acknowledgements.html
      - copied, changed from r77042, /trunk/libs/scope_exit/doc/html/scope_exit/Acknowledgements.html
   branches/release/libs/scope_exit/doc/html/scope_exit/Getting_Started.html
      - copied, changed from r77042, /trunk/libs/scope_exit/doc/html/scope_exit/Getting_Started.html
   branches/release/libs/scope_exit/doc/html/scope_exit/No_Variadic_Macros.html
      - copied, changed from r77042, /trunk/libs/scope_exit/doc/html/scope_exit/No_Variadic_Macros.html
   branches/release/libs/scope_exit/doc/html/scope_exit/alternatives.html
      - copied, changed from r77042, /trunk/libs/scope_exit/doc/html/scope_exit/alternatives.html
   branches/release/libs/scope_exit/doc/html/scope_exit/tutorial.html
      - copied unchanged from r77042, /trunk/libs/scope_exit/doc/html/scope_exit/tutorial.html
   branches/release/libs/scope_exit/example/Jamfile.v2
      - copied, changed from r77042, /trunk/libs/scope_exit/example/Jamfile.v2
   branches/release/libs/scope_exit/example/nova.hpp
      - copied unchanged from r77586, /trunk/libs/scope_exit/example/nova.hpp
   branches/release/libs/scope_exit/example/scope_guard.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/example/scope_guard.cpp
   branches/release/libs/scope_exit/example/scope_guard_seq.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/example/scope_guard_seq.cpp
   branches/release/libs/scope_exit/example/scope_guard_seq_nova.cpp
      - copied unchanged from r77586, /trunk/libs/scope_exit/example/scope_guard_seq_nova.cpp
   branches/release/libs/scope_exit/example/try_catch.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/example/try_catch.cpp
   branches/release/libs/scope_exit/example/try_catch_seq.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/example/try_catch_seq.cpp
   branches/release/libs/scope_exit/example/try_catch_seq_nova.cpp
      - copied unchanged from r77586, /trunk/libs/scope_exit/example/try_catch_seq_nova.cpp
   branches/release/libs/scope_exit/example/world_cxx11_lambda.cpp
      - copied unchanged from r77830, /trunk/libs/scope_exit/example/world_cxx11_lambda.cpp
   branches/release/libs/scope_exit/test/native_this.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/test/native_this.cpp
   branches/release/libs/scope_exit/test/native_this_tpl.cpp
      - copied, changed from r77411, /trunk/libs/scope_exit/test/native_this_tpl.cpp
   branches/release/libs/scope_exit/test/nova.hpp
      - copied unchanged from r77586, /trunk/libs/scope_exit/test/nova.hpp
   branches/release/libs/scope_exit/test/same_line.cpp
      - copied, changed from r77411, /trunk/libs/scope_exit/test/same_line.cpp
   branches/release/libs/scope_exit/test/same_line_seq.cpp
      - copied, changed from r77411, /trunk/libs/scope_exit/test/same_line_seq.cpp
   branches/release/libs/scope_exit/test/same_line_seq_nova.cpp
      - copied unchanged from r77586, /trunk/libs/scope_exit/test/same_line_seq_nova.cpp
   branches/release/libs/scope_exit/test/world.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/test/world.cpp
   branches/release/libs/scope_exit/test/world_checkpoint.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/test/world_checkpoint.cpp
   branches/release/libs/scope_exit/test/world_checkpoint_all.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/test/world_checkpoint_all.cpp
   branches/release/libs/scope_exit/test/world_checkpoint_all_seq.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/test/world_checkpoint_all_seq.cpp
   branches/release/libs/scope_exit/test/world_checkpoint_all_seq_nova.cpp
      - copied unchanged from r77586, /trunk/libs/scope_exit/test/world_checkpoint_all_seq_nova.cpp
   branches/release/libs/scope_exit/test/world_checkpoint_seq.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/test/world_checkpoint_seq.cpp
   branches/release/libs/scope_exit/test/world_checkpoint_seq_nova.cpp
      - copied unchanged from r77586, /trunk/libs/scope_exit/test/world_checkpoint_seq_nova.cpp
   branches/release/libs/scope_exit/test/world_seq.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/test/world_seq.cpp
   branches/release/libs/scope_exit/test/world_seq_nova.cpp
      - copied unchanged from r77586, /trunk/libs/scope_exit/test/world_seq_nova.cpp
   branches/release/libs/scope_exit/test/world_this.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/test/world_this.cpp
   branches/release/libs/scope_exit/test/world_this_seq.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/test/world_this_seq.cpp
   branches/release/libs/scope_exit/test/world_this_seq_nova.cpp
      - copied unchanged from r77586, /trunk/libs/scope_exit/test/world_this_seq_nova.cpp
   branches/release/libs/scope_exit/test/world_tpl.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/test/world_tpl.cpp
   branches/release/libs/scope_exit/test/world_tpl_seq.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/test/world_tpl_seq.cpp
   branches/release/libs/scope_exit/test/world_tpl_seq_nova.cpp
      - copied unchanged from r77586, /trunk/libs/scope_exit/test/world_tpl_seq_nova.cpp
   branches/release/libs/scope_exit/test/world_void.cpp
      - copied, changed from r77042, /trunk/libs/scope_exit/test/world_void.cpp
   branches/release/libs/scope_exit/test/world_void_nova.cpp
      - copied unchanged from r77830, /trunk/libs/scope_exit/test/world_void_nova.cpp
   branches/release/libs/utility/identity_type/ (props changed)
      - copied from r77029, /trunk/libs/utility/identity_type/
   branches/release/libs/utility/identity_type/test/abstract.cpp
      - copied unchanged from r77586, /trunk/libs/utility/identity_type/test/abstract.cpp
   branches/release/libs/utility/identity_type/test/noncopyable.cpp
      - copied unchanged from r77586, /trunk/libs/utility/identity_type/test/noncopyable.cpp
   branches/release/libs/utility/identity_type/test/paren.cpp
      - copied unchanged from r77586, /trunk/libs/utility/identity_type/test/paren.cpp
   branches/release/libs/utility/identity_type/test/var_error.cpp
      - copied unchanged from r77319, /trunk/libs/utility/identity_type/test/var_error.cpp
Removed:
   branches/release/boost/local_function/aux_/config.hpp
   branches/release/boost/local_function/aux_/macro/code_/end.hpp
   branches/release/boost/local_function/aux_/macro/code_/name.hpp
   branches/release/libs/functional/overloaded_function/test/identity.cpp
   branches/release/libs/local_function/example/const_block_err.cpp
   branches/release/libs/local_function/example/expensive_copy_lambda.cpp
   branches/release/libs/local_function/example/gcc_lambda_cpp11.cpp
   branches/release/libs/local_function/example/noncopyable_lambda_err.cpp
   branches/release/libs/local_function/example/profile_gcc_cpp11_debug.png
   branches/release/libs/local_function/example/profile_gcc_cpp11_release.png
   branches/release/libs/local_function/example/profile_lambda.cpp
   branches/release/libs/local_function/example/profile_legend_lambda.png
   branches/release/libs/local_function/test/add_lambda.cpp
   branches/release/libs/local_function/test/add_params.cpp
   branches/release/libs/local_function/test/goto_err.cpp
   branches/release/libs/local_function/test/operator_err.cpp
   branches/release/libs/local_function/test/seq.cpp
   branches/release/libs/scope_exit/doc/html/scope_exit/acknowledge.html
   branches/release/libs/scope_exit/doc/html/scope_exit/compilers.html
   branches/release/libs/scope_exit/doc/html/scope_exit/conf.html
   branches/release/libs/scope_exit/doc/html/scope_exit/ref.html
   branches/release/libs/scope_exit/example/world.cpp
   branches/release/libs/scope_exit/test/emulation.cpp
   branches/release/libs/scope_exit/test/emulation_const_error.cpp
   branches/release/libs/scope_exit/test/emulation_cv_error.cpp
   branches/release/libs/scope_exit/test/emulation_tpl.cpp
   branches/release/libs/scope_exit/test/emulation_tu_test.cpp
   branches/release/libs/utility/identity_type/test/tmp_assert.cpp
   branches/release/libs/utility/identity_type/test/var_err.cpp
Properties modified:
   branches/release/ (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost/functional/ (props changed)
   branches/release/boost/scope_exit.hpp (contents, props changed)
   branches/release/boost/utility/ (props changed)
   branches/release/libs/ (props changed)
   branches/release/libs/functional/ (props changed)
   branches/release/libs/functional/overloaded_function/doc/ (props changed)
   branches/release/libs/functional/overloaded_function/doc/html/ (props changed)
   branches/release/libs/libraries.htm (contents, props changed)
   branches/release/libs/local_function/doc/html/ (props changed)
   branches/release/libs/maintainers.txt (contents, props changed)
   branches/release/libs/scope_exit/ (props changed)
   branches/release/libs/scope_exit/doc/ (props changed)
   branches/release/libs/scope_exit/doc/html/ (props changed)
   branches/release/libs/utility/ (props changed)
   branches/release/libs/utility/identity_type/doc/ (props changed)
   branches/release/libs/utility/identity_type/doc/html/ (props changed)
   branches/release/status/Jamfile.v2 (contents, props changed)
   branches/release/status/explicit-failures-markup.xml (contents, props changed)
Text files modified:
   branches/release/boost/functional/overloaded_function.hpp | 86 +-
   branches/release/boost/functional/overloaded_function/config.hpp | 16
   branches/release/boost/functional/overloaded_function/detail/base.hpp | 1
   branches/release/boost/functional/overloaded_function/detail/function_type.hpp | 16
   branches/release/boost/local_function.hpp | 316 ++++++--
   branches/release/boost/local_function/aux_/function.hpp | 37
   branches/release/boost/local_function/aux_/macro/code_/bind.hpp | 50
   branches/release/boost/local_function/aux_/macro/code_/functor.hpp | 77 +-
   branches/release/boost/local_function/aux_/macro/code_/result.hpp | 104 +-
   branches/release/boost/local_function/aux_/macro/name.hpp | 78 +-
   branches/release/boost/local_function/aux_/member.hpp | 18
   branches/release/boost/local_function/aux_/nobind.hpp | 10
   branches/release/boost/local_function/config.hpp | 63 +
   branches/release/boost/local_function/detail/preprocessor/keyword/facility/add.hpp | 4
   branches/release/boost/local_function/detail/preprocessor/void_list.hpp | 2
   branches/release/boost/scope_exit.hpp | 1349 +++++++++++++++++++++++++++++++++++----
   branches/release/boost/utility/identity_type.hpp | 11
   branches/release/libs/functional/overloaded_function/doc/Jamfile.v2 | 2
   branches/release/libs/functional/overloaded_function/doc/html/BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX.html | 2
   branches/release/libs/functional/overloaded_function/doc/html/BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX.html | 2
   branches/release/libs/functional/overloaded_function/doc/html/boost/make_overloaded_function.html | 8
   branches/release/libs/functional/overloaded_function/doc/html/boost/overloaded_function.html | 47
   branches/release/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/Getting_Started.html | 24
   branches/release/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/Tutorial.html | 70 +
   branches/release/libs/functional/overloaded_function/doc/html/index.html | 37
   branches/release/libs/functional/overloaded_function/doc/html/reference.html | 2
   branches/release/libs/functional/overloaded_function/doc/overloaded_function.qbk | 69 +
   branches/release/libs/functional/overloaded_function/test/Jamfile.v2 | 7
   branches/release/libs/functional/overloaded_function/test/functor.cpp | 19
   branches/release/libs/functional/overloaded_function/test/identity.hpp | 6
   branches/release/libs/functional/overloaded_function/test/make_call.cpp | 12
   branches/release/libs/functional/overloaded_function/test/make_decl.cpp | 15
   branches/release/libs/libraries.htm | 20
   branches/release/libs/local_function/doc/Jamfile.v2 | 2
   branches/release/libs/local_function/doc/acknowledgements.qbk | 10
   branches/release/libs/local_function/doc/advanced_topics.qbk | 175 +++--
   branches/release/libs/local_function/doc/alternatives.qbk | 92 +-
   branches/release/libs/local_function/doc/bibliography.qbk | 2
   branches/release/libs/local_function/doc/examples.qbk | 83 +-
   branches/release/libs/local_function/doc/getting_started.qbk | 37
   branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION.html | 16
   branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html | 2
   branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html | 8
   branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html | 18
   branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_ID.html | 26
   branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_NAME.html | 37
   branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_NAME_TPL.html | 19
   branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_TPL.html | 20
   branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_TYPEOF.html | 12
   branches/release/libs/local_function/doc/html/boost_localfunction/Acknowledgments.html | 15
   branches/release/libs/local_function/doc/html/boost_localfunction/Advanced_Topics.html | 510 +++++++++-----
   branches/release/libs/local_function/doc/html/boost_localfunction/Alternatives.html | 186 +++--
   branches/release/libs/local_function/doc/html/boost_localfunction/Examples.html | 252 +++++--
   branches/release/libs/local_function/doc/html/boost_localfunction/Getting_Started.html | 67 -
   branches/release/libs/local_function/doc/html/boost_localfunction/Implementation.html | 66 +
   branches/release/libs/local_function/doc/html/boost_localfunction/No_Variadic_Macros.html | 315 ++++-----
   branches/release/libs/local_function/doc/html/boost_localfunction/Release_Notes.html | 21
   branches/release/libs/local_function/doc/html/boost_localfunction/Tutorial.html | 138 +--
   branches/release/libs/local_function/doc/html/index.html | 62
   branches/release/libs/local_function/doc/html/reference.html | 16
   branches/release/libs/local_function/doc/implementation.qbk | 20
   branches/release/libs/local_function/doc/introduction.qbk | 24
   branches/release/libs/local_function/doc/local_function.qbk | 57
   branches/release/libs/local_function/doc/no_variadic_macros.qbk | 41
   branches/release/libs/local_function/doc/release_notes.qbk | 15
   branches/release/libs/local_function/doc/tutorial.qbk | 53
   branches/release/libs/local_function/example/Jamfile.v2 | 21
   branches/release/libs/local_function/example/add_global_functor.cpp | 9
   branches/release/libs/local_function/example/add_local_functor.cpp | 10
   branches/release/libs/local_function/example/add_phoenix.cpp | 11
   branches/release/libs/local_function/example/chrono.py | 5
   branches/release/libs/local_function/example/const_block.hpp | 15
   branches/release/libs/local_function/example/expensive_copy_cxx11_lambda.cpp | 1
   branches/release/libs/local_function/example/expensive_copy_local_function.cpp | 9
   branches/release/libs/local_function/example/gcc_access.cpp | 12
   branches/release/libs/local_function/example/gcc_lambda.cpp | 20
   branches/release/libs/local_function/example/gcc_lambda.hpp | 4
   branches/release/libs/local_function/example/gcc_square.cpp | 12
   branches/release/libs/local_function/example/gcc_store.cpp | 12
   branches/release/libs/local_function/example/impl_pp_keyword.cpp | 10
   branches/release/libs/local_function/example/impl_tparam_tricks.cpp | 23
   branches/release/libs/local_function/example/n2529_this.cpp | 17
   branches/release/libs/local_function/example/n2550_find_if.cpp | 15
   branches/release/libs/local_function/example/noncopyable_cxx11_lambda_error.cpp | 3
   branches/release/libs/local_function/example/noncopyable_local_function.cpp | 7
   branches/release/libs/local_function/example/phoenix_factorial.cpp | 10
   branches/release/libs/local_function/example/phoenix_factorial_local.cpp | 10
   branches/release/libs/local_function/example/scope_exit.cpp | 16
   branches/release/libs/local_function/example/scope_exit.hpp | 4
   branches/release/libs/local_function/test/Jamfile.v2 | 72 +
   branches/release/libs/local_function/test/add.cpp | 16
   branches/release/libs/local_function/test/add_classifiers.cpp | 20
   branches/release/libs/local_function/test/add_classifiers_seq.cpp | 18
   branches/release/libs/local_function/test/add_default.cpp | 18
   branches/release/libs/local_function/test/add_default_seq.cpp | 8
   branches/release/libs/local_function/test/add_except.cpp | 17
   branches/release/libs/local_function/test/add_except_seq.cpp | 8
   branches/release/libs/local_function/test/add_inline.cpp | 18
   branches/release/libs/local_function/test/add_inline_seq.cpp | 8
   branches/release/libs/local_function/test/add_params_only.cpp | 18
   branches/release/libs/local_function/test/add_params_only_seq.cpp | 8
   branches/release/libs/local_function/test/add_seq.cpp | 9
   branches/release/libs/local_function/test/add_template.cpp | 19
   branches/release/libs/local_function/test/add_template_seq.cpp | 10
   branches/release/libs/local_function/test/add_this.cpp | 23
   branches/release/libs/local_function/test/add_this_seq.cpp | 13
   branches/release/libs/local_function/test/add_typed.cpp | 20
   branches/release/libs/local_function/test/add_typed_seq.cpp | 10
   branches/release/libs/local_function/test/add_with_default.cpp | 16
   branches/release/libs/local_function/test/add_with_default_seq.cpp | 8
   branches/release/libs/local_function/test/addable.hpp | 9
   branches/release/libs/local_function/test/all_decl.cpp | 15
   branches/release/libs/local_function/test/all_decl_seq.cpp | 5
   branches/release/libs/local_function/test/factorial.cpp | 24
   branches/release/libs/local_function/test/factorial_seq.cpp | 17
   branches/release/libs/local_function/test/goto.cpp | 16
   branches/release/libs/local_function/test/goto_error.cpp | 19
   branches/release/libs/local_function/test/goto_error_seq.cpp | 11
   branches/release/libs/local_function/test/goto_seq.cpp | 9
   branches/release/libs/local_function/test/macro_commas.cpp | 20
   branches/release/libs/local_function/test/macro_commas_seq.cpp | 12
   branches/release/libs/local_function/test/nesting.cpp | 16
   branches/release/libs/local_function/test/nesting_seq.cpp | 8
   branches/release/libs/local_function/test/operator.cpp | 20
   branches/release/libs/local_function/test/operator_error.cpp | 22
   branches/release/libs/local_function/test/operator_error_seq.cpp | 11
   branches/release/libs/local_function/test/operator_seq.cpp | 11
   branches/release/libs/local_function/test/overload.cpp | 29
   branches/release/libs/local_function/test/overload_seq.cpp | 16
   branches/release/libs/local_function/test/return_assign.cpp | 21
   branches/release/libs/local_function/test/return_assign_seq.cpp | 14
   branches/release/libs/local_function/test/return_derivative.cpp | 22
   branches/release/libs/local_function/test/return_derivative_seq.cpp | 13
   branches/release/libs/local_function/test/return_inc.cpp | 21
   branches/release/libs/local_function/test/return_inc_seq.cpp | 14
   branches/release/libs/local_function/test/return_setget.cpp | 18
   branches/release/libs/local_function/test/return_setget_seq.cpp | 11
   branches/release/libs/local_function/test/return_this.cpp | 26
   branches/release/libs/local_function/test/return_this_seq.cpp | 19
   branches/release/libs/local_function/test/same_line.cpp | 46
   branches/release/libs/local_function/test/same_line_seq.cpp | 34
   branches/release/libs/local_function/test/ten_void.cpp | 9
   branches/release/libs/local_function/test/transform.cpp | 19
   branches/release/libs/local_function/test/transform_seq.cpp | 13
   branches/release/libs/local_function/test/typeof.cpp | 19
   branches/release/libs/local_function/test/typeof_seq.cpp | 8
   branches/release/libs/local_function/test/typeof_template.cpp | 17
   branches/release/libs/local_function/test/typeof_template_seq.cpp | 10
   branches/release/libs/maintainers.txt | 7
   branches/release/libs/scope_exit/doc/Jamfile.v2 | 39
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html | 23
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html | 36
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html | 2
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS.html | 2
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDA_IMPL.html | 2
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html | 26
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html | 19
   branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL_ID.html | 2
   branches/release/libs/scope_exit/doc/html/index.html | 114 ++
   branches/release/libs/scope_exit/doc/html/reference.html | 12
   branches/release/libs/scope_exit/doc/html/scope_exit/Acknowledgements.html | 20
   branches/release/libs/scope_exit/doc/html/scope_exit/Getting_Started.html | 66 +
   branches/release/libs/scope_exit/doc/html/scope_exit/No_Variadic_Macros.html | 97 +
   branches/release/libs/scope_exit/doc/html/scope_exit/alternatives.html | 2
   branches/release/libs/scope_exit/doc/scope_exit.qbk | 798 ++++++++++++-----------
   branches/release/libs/scope_exit/example/Jamfile.v2 | 11
   branches/release/libs/scope_exit/example/scope_guard.cpp | 9
   branches/release/libs/scope_exit/example/scope_guard_seq.cpp | 5
   branches/release/libs/scope_exit/example/try_catch.cpp | 14
   branches/release/libs/scope_exit/example/try_catch_seq.cpp | 7
   branches/release/libs/scope_exit/index.html | 25
   branches/release/libs/scope_exit/test/Jamfile.v2 | 68 +
   branches/release/libs/scope_exit/test/native.cpp | 210 +++--
   branches/release/libs/scope_exit/test/native_const_error.cpp | 16
   branches/release/libs/scope_exit/test/native_cv_error.cpp | 20
   branches/release/libs/scope_exit/test/native_this.cpp | 34
   branches/release/libs/scope_exit/test/native_this_tpl.cpp | 22
   branches/release/libs/scope_exit/test/native_tpl.cpp | 82 +-
   branches/release/libs/scope_exit/test/native_tu1.cpp | 15
   branches/release/libs/scope_exit/test/native_tu2.cpp | 15
   branches/release/libs/scope_exit/test/native_tu_test.cpp | 31
   branches/release/libs/scope_exit/test/same_line.cpp | 56 +
   branches/release/libs/scope_exit/test/same_line_seq.cpp | 42
   branches/release/libs/scope_exit/test/tu_test.hpp | 43
   branches/release/libs/scope_exit/test/world.cpp | 22
   branches/release/libs/scope_exit/test/world_checkpoint.cpp | 65 +
   branches/release/libs/scope_exit/test/world_checkpoint_all.cpp | 80 +-
   branches/release/libs/scope_exit/test/world_checkpoint_all_seq.cpp | 76 +-
   branches/release/libs/scope_exit/test/world_checkpoint_seq.cpp | 66 -
   branches/release/libs/scope_exit/test/world_seq.cpp | 24
   branches/release/libs/scope_exit/test/world_this.cpp | 32
   branches/release/libs/scope_exit/test/world_this_seq.cpp | 27
   branches/release/libs/scope_exit/test/world_tpl.cpp | 22
   branches/release/libs/scope_exit/test/world_tpl_seq.cpp | 17
   branches/release/libs/scope_exit/test/world_void.cpp | 14
   branches/release/libs/utility/identity_type/doc/Jamfile.v2 | 2
   branches/release/libs/utility/identity_type/doc/html/index.html | 178 ++--
   branches/release/libs/utility/identity_type/doc/identity_type.qbk | 70 +
   branches/release/libs/utility/identity_type/test/Jamfile.v2 | 6
   branches/release/libs/utility/identity_type/test/template.cpp | 10
   branches/release/libs/utility/identity_type/test/var.cpp | 6
   branches/release/status/Jamfile.v2 | 3
   branches/release/status/explicit-failures-markup.xml | 55 -
   203 files changed, 5661 insertions(+), 3360 deletions(-)

Copied: branches/release/boost/functional/overloaded_function.hpp (from r77025, /trunk/boost/functional/overloaded_function.hpp)
==============================================================================
--- /trunk/boost/functional/overloaded_function.hpp (original)
+++ branches/release/boost/functional/overloaded_function.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -14,6 +14,7 @@
 # include <boost/functional/overloaded_function/detail/base.hpp>
 # include <boost/functional/overloaded_function/detail/function_type.hpp>
 # include <boost/functional/overloaded_function/config.hpp>
+# include <boost/typeof/typeof.hpp>
 # include <boost/preprocessor/iteration/iterate.hpp>
 # include <boost/preprocessor/repetition/enum.hpp>
 # include <boost/preprocessor/repetition/repeat.hpp>
@@ -23,6 +24,7 @@
 # include <boost/preprocessor/comparison/less.hpp>
 # include <boost/preprocessor/cat.hpp>
 # include <boost/preprocessor/arithmetic/add.hpp>
+# include <boost/preprocessor/arithmetic/sub.hpp>
 # include <boost/preprocessor/tuple/eat.hpp>
 # include <boost/preprocessor/logical/and.hpp>
 # include <boost/preprocessor/logical/not.hpp>
@@ -81,17 +83,13 @@
         BOOST_FUNCTIONAL_f_type(z, n, ~) \
>::type
 
-namespace boost {
-
-// Iterate within namespace.
 # define BOOST_PP_ITERATION_PARAMS_1 \
- (3, (0, BOOST_PP_SUB( /*at least 2 func to overload 2, 3, ...*/\
- BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, 2), \
- "boost/functional/overloaded_function.hpp"))
+ /* at least 2 func to overload so start from 2 to MAX */ \
+ /* (cannot iterate [0, MAX-2) because error on Sun) */ \
+ (3, (2, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
+ "boost/functional/overloaded_function.hpp"))
 # include BOOST_PP_ITERATE() // Iterate over function arity.
 
-} // namespace
-
 #undef BOOST_FUNCTIONAL_f_type
 #undef BOOST_FUNCTIONAL_f_arg
 #undef BOOST_FUNCTIONAL_f_tparam
@@ -112,13 +110,20 @@
 #elif BOOST_PP_ITERATION_DEPTH() == 1
 # define BOOST_FUNCTIONAL_overloads \
         /* iterate as OVERLOADS, OVERLOADS-1, OVERLOADS-2, ... */ \
- BOOST_PP_SUB(BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
- BOOST_PP_FRAME_ITERATION(1))
+ /* (add 2 because iteration started from 2 to MAX) */ \
+ BOOST_PP_ADD(2, BOOST_PP_SUB( \
+ BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
+ BOOST_PP_FRAME_ITERATION(1)))
 # define BOOST_FUNCTIONAL_is_tspec \
         /* if template specialization */ \
         BOOST_PP_LESS(BOOST_FUNCTIONAL_overloads, \
                 BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX)
 
+// For type-of emulation: This must be included at this pp iteration level.
+# include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+namespace boost {
+
 template<
     BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_tparam_dflt,
             BOOST_FUNCTIONAL_is_tspec)
@@ -165,6 +170,12 @@
>(BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_arg, ~));
 }
 
+} // namespace
+
+// For type-of emulation: Register overloaded function type (for _AUTO, etc).
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::overloaded_function,
+ BOOST_FUNCTIONAL_overloads)
+
 # undef BOOST_FUNCTIONAL_overloads
 # undef BOOST_FUNCTIONAL_is_tspec
 #endif // iteration
@@ -174,8 +185,8 @@
 #else // DOXYGEN
 
 /** @file
-_at_brief Overload distinct function pointers, function references, and function
-objects into a single function object.
+@brief Overload distinct function pointers, function references, and
+monomorphic function objects into a single function object.
 */
 
 namespace boost {
@@ -184,18 +195,25 @@
 @brief Function object to overload functions with distinct signatures.
 
 This function object aggregates together calls to functions of all the
-specified function types <c>F1</c>, <c>F2</c>, etc.
-The specified function types must have distinct parameters from one another and
-they must be in the following format (which is the Boost.Function preferred
-syntax):
+specified function types <c>F1</c>, <c>F2</c>, etc which must have distinct
+function signatures from one another.
+
+@Params
+@Param{F<em>i</em>,
+Each function type must be specified using the following syntax (which is
+Boost.Function's preferred syntax):
 @code
- result_type (argument1_type, argumgnet2_type, ...)
+ result_type (argument1_type\, argumgnet2_type\, ...)
 @endcode
+}
+@EndParams
 
 In some cases, the @RefFunc{make_overloaded_function} function template can be
-useful to construct the overloaded function object without explicitly
+useful to construct an overloaded function object without explicitly
 specifying the function types.
 
+At least two distinct function types must be specified (because there is
+nothing to overload between one or zero functions).
 The maximum number of functions to overload is given by the
 @RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}
 configuration macro.
@@ -204,12 +222,10 @@
 @RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX}
 configuration macro.
 
-_at_See
- @RefSect{Tutorial} section,
- @RefFunc{make_overloaded_function},
- @RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX},
- @RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX},
- Boost.Function.
+@See @RefSect{tutorial, Tutorial} section, @RefFunc{make_overloaded_function},
+@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX},
+@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX},
+Boost.Function.
 */
 template<typename F1, typename F2, ...>
 class overloaded_function {
@@ -220,6 +236,10 @@
     Any function pointer, function reference, and monomorphic function object
     that can be converted to a <c>boost::function</c> function object can be
     specified as parameter.
+
+ @Note Unfortunately, it is not possible to support polymorphic function
+ objects (as explained <a
+ href="http://lists.boost.org/Archives/boost/2012/03/191744.php">here</a>).
     */
     overloaded_function(const boost::function<F1>&,
             const boost::function<F2>&, ...);
@@ -258,29 +278,27 @@
 function types.
 
 This function template creates and returns an @RefClass{overloaded_function}
-function object that overloads all the specified functions <c>f1</c>,
-<c>f2</c>, etc.
+object that overloads all the specified functions <c>f1</c>, <c>f2</c>, etc.
 
 The function types are internally determined from the template parameter types
 so they do not need to be explicitly specified.
 Therefore, this function template usually has a more concise syntax when
 compared with @RefClass{overloaded_function}.
 This is especially useful when the explicit type of the returned
-_at_RefClass{overloaded_function} does not need to be known (e.g., when used with Boost.Typeof's <c>BOOST_AUTO</c> (or C++11 <c>auto</c>) or when the overloaded
-function object is handled using a function template parameter, see the
-_at_RefSect{Tutorial} section).
+@RefClass{overloaded_function} object does not need to be known (e.g., when
+used with Boost.Typeof's <c>BOOST_AUTO</c>, C++11 <c>auto</c>, or when the
+overloaded function object is handled using a function template parameter, see
+the @RefSect{tutorial, Tutorial} section).
 
 The maximum number of functions to overload is given by the
 @RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}
 configuration macro.
 
 @Note In this documentation, <c>__function_type__</c> is a placeholder for a
-symbol that is specific to implementation of this library.
+symbol that is specific to the implementation of this library.
 
-_at_See
- @RefSect{Tutorial} section,
- @RefClass{overloaded_function},
- @RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}.
+@See @RefSect{tutorial, Tutorial} section, @RefClass{overloaded_function},
+@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}.
 */
 template<typename F1, typename F2, ...>
 overloaded_function<

Modified: branches/release/boost/functional/overloaded_function/config.hpp
==============================================================================
--- /trunk/boost/functional/overloaded_function/config.hpp (original)
+++ branches/release/boost/functional/overloaded_function/config.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -20,12 +20,11 @@
 (increasing this number might increase compilation time).
 When specified by the user, this macro must be a non-negative integer number.
 
-_at_See
- @RefSectId{Getting_Started, Getting Started},
- @RefClass{boost::overloaded_function}.
+@See @RefSect{getting_started, Getting Started},
+@RefClass{boost::overloaded_function}.
 */
 #ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX
-#define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX 5
+# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX 5
 #endif
 
 /**
@@ -37,15 +36,14 @@
 equal than 2 (because at least two distinct functions need to be specified in
 order to define an overload).
 
-_at_See
- @RefSectId{Getting_Started, Getting Started},
- @RefClass{boost::overloaded_function}.
+@See @RefSect{getting_started, Getting Started},
+@RefClass{boost::overloaded_function}.
 */
 #ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX
-#define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX 5
+# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX 5
 #endif
 #if BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX < 2
-#error "BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX must be >= 2"
+# error "maximum overload macro cannot be less than 2"
 #endif
 
 #endif // #include guard

Modified: branches/release/boost/functional/overloaded_function/detail/base.hpp
==============================================================================
--- /trunk/boost/functional/overloaded_function/detail/base.hpp (original)
+++ branches/release/boost/functional/overloaded_function/detail/base.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -33,6 +33,7 @@
     R (BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity, \
             BOOST_FUNCTIONAL_DETAIL_arg_type, ~))
 
+// Do not use namespace ::detail because overloaded_function is already a class.
 namespace boost { namespace overloaded_function_detail {
 
 template<typename F>

Modified: branches/release/boost/functional/overloaded_function/detail/function_type.hpp
==============================================================================
--- /trunk/boost/functional/overloaded_function/detail/function_type.hpp (original)
+++ branches/release/boost/functional/overloaded_function/detail/function_type.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -16,12 +16,14 @@
 #include <boost/function_types/result_type.hpp>
 #include <boost/type_traits/remove_pointer.hpp>
 #include <boost/type_traits/remove_reference.hpp>
+#include <boost/function.hpp>
 #include <boost/mpl/if.hpp>
 #include <boost/mpl/identity.hpp>
 #include <boost/mpl/pop_front.hpp>
 #include <boost/mpl/push_front.hpp>
 #include <boost/typeof/typeof.hpp>
 
+// Do not use namespace ::detail because overloaded_function is already a class.
 namespace boost { namespace overloaded_function_detail {
 
 // Requires: F is a monomorphic functor (i.e., has non-template `operator()`).
@@ -29,7 +31,8 @@
 // It does not assume F typedef result_type, arg1_type, ... but needs typeof.
 template<typename F>
 class functor_type {
- typedef BOOST_TYPEOF_TPL(&(F::operator())) call_ptr;
+ // NOTE: clang does not accept extra parenthesis `&(...)`.
+ typedef BOOST_TYPEOF_TPL(&F::operator()) call_ptr;
 public:
     typedef
         typename boost::function_types::function_type<
@@ -44,6 +47,15 @@
     type;
 };
 
+// NOTE: When using boost::function in Boost.Typeof emulation mode, the user
+// has to register boost::functionN instead of boost::function in oder to
+// do TYPEOF(F::operator()). That is confusing, so boost::function is handled
+// separately so it does not require any Boost.Typeof registration at all.
+template<typename F>
+struct functor_type< boost::function<F> > {
+ typedef F type;
+};
+
 // Requires: F is a function type, pointer, reference, or monomorphic functor.
 // Returns: F's function type `result_type (arg1_type, arg2_type, ...)`.
 template<typename F>
@@ -59,7 +71,7 @@
                 typename boost::mpl::if_<boost::function_types::
                         is_function_reference<F>,
                     boost::remove_reference<F>
- , // Requires, it's a functor.
+ , // Else, requires that F is a functor.
                     functor_type<F>
>::type
>::type

Copied: branches/release/boost/local_function.hpp (from r77024, /trunk/boost/local_function.hpp)
==============================================================================
--- /trunk/boost/local_function.hpp (original)
+++ branches/release/boost/local_function.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -21,39 +21,43 @@
 // PUBLIC //
 
 #ifdef BOOST_NO_VARIADIC_MACROS
+# define BOOST_LOCAL_FUNCTION_ID(id, declarations) \
+ BOOST_LOCAL_FUNCTION_AUX_DECL(id, 0 /* not within template */, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST( \
+ declarations)))
 # define BOOST_LOCAL_FUNCTION(declarations) \
- BOOST_LOCAL_FUNCTION_AUX_DECL( \
- BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER \
- , 0 /* not within template */ \
- , BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS( \
- BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(declarations)) \
- )
+ BOOST_LOCAL_FUNCTION_ID( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, declarations)
+# define BOOST_LOCAL_FUNCTION_ID_TPL(id, declarations) \
+ BOOST_LOCAL_FUNCTION_AUX_DECL(id, 1 /* within template */, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST( \
+ declarations)))
 # define BOOST_LOCAL_FUNCTION_TPL(declarations) \
- BOOST_LOCAL_FUNCTION_AUX_DECL( \
- BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER \
- , 1 /* within template */ \
- , BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS( \
- BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(declarations)) \
- )
+ BOOST_LOCAL_FUNCTION_ID_TPL( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, declarations)
 #else // VARIADIC
+# define BOOST_LOCAL_FUNCTION_ID(id, ...) \
+ BOOST_LOCAL_FUNCTION_AUX_DECL(id, 0 /* not within template */, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(__VA_ARGS__)))
 # define BOOST_LOCAL_FUNCTION(...) \
- BOOST_LOCAL_FUNCTION_AUX_DECL( \
- BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER \
- , 0 /* not within template */ \
- , BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS( \
- BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(__VA_ARGS__)) \
- )
+ BOOST_LOCAL_FUNCTION_ID( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, __VA_ARGS__)
+# define BOOST_LOCAL_FUNCTION_ID_TPL(id, ...) \
+ BOOST_LOCAL_FUNCTION_AUX_DECL(id, 1 /* within template */, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(__VA_ARGS__)))
 # define BOOST_LOCAL_FUNCTION_TPL(...) \
- BOOST_LOCAL_FUNCTION_AUX_DECL( \
- BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER \
- , 1 /* within template */ \
- , BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS( \
- BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(__VA_ARGS__)) \
- )
+ BOOST_LOCAL_FUNCTION_ID_TPL( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, __VA_ARGS__)
 #endif // VARIADIC
 
-#define BOOST_LOCAL_FUNCTION_NAME(qualified_function_name) \
- BOOST_LOCAL_FUNCTION_AUX_NAME(qualified_function_name)
+#define BOOST_LOCAL_FUNCTION_NAME(qualified_name) \
+ BOOST_LOCAL_FUNCTION_AUX_NAME(0 /* not within template */, qualified_name)
+#define BOOST_LOCAL_FUNCTION_NAME_TPL(qualified_name) \
+ BOOST_LOCAL_FUNCTION_AUX_NAME(1 /* within template */, qualified_name)
 
 #define BOOST_LOCAL_FUNCTION_TYPEOF(bound_variable_name) \
     BOOST_LOCAL_FUNCTION_AUX_TYPEOF_TYPE(bound_variable_name)
@@ -63,8 +67,8 @@
 #else // DOXYGEN
 
 /** @file
-_at_brief Local functions allow to program functions locally, directly within the
-scope where they are needed.
+@brief Local functions allow to program functions locally, within other
+functions, and directly within the scope where they are needed.
 */
 
 /**
@@ -73,13 +77,14 @@
 This macro must be used within a declarative context, it must follow the local
 function result type, it must be followed by the local function body code, and
 then by the @RefMacro{BOOST_LOCAL_FUNCTION_NAME} macro (see the
-_at_RefSect{Tutorial} and @RefSectId{Advanced_Topics, Advanced Topics} sections):
+@RefSect{tutorial, Tutorial} and @RefSect{advanced_topics, Advanced Topics}
+sections):
 @code
 { // Some declarative context.
     ...
     result_type BOOST_LOCAL_FUNCTION(declarations) {
         ... // Body code.
- } BOOST_LOCAL_FUNCTION_NAME(qualified_function_name)
+ } BOOST_LOCAL_FUNCTION_NAME(qualified_name)
     ...
 }
 @endcode
@@ -88,10 +93,10 @@
 macro and before the body code block <c>{ ... }</c> (but the exception
 specifications will only apply to the body code and not to the library code
 automatically generated by the macro expansion, see the
-_at_RefSectId{Advanced_Topics, Advanced Topics} section).
+@RefSect{advanced_topics, Advanced Topics} section).
 
-Within templates, the special macro @RefMacro{BOOST_LOCAL_FUNCTION_TPL} must be
-used instead of_at_RefMacro{BOOST_LOCAL_FUNCTION}.
+Within templates, the special macros @RefMacro{BOOST_LOCAL_FUNCTION_TPL}
+and @RefMacro{BOOST_LOCAL_FUNCTION_NAME_TPL} must be used.
 
 @Params
 @Param{declarations,
@@ -122,16 +127,15 @@
             void | declaration_sequence
 @endcode
 
-Lexical conventions: <c>token1 | token2</c> means either <c>token1</c> or
+(Lexical conventions: <c>token1 | token2</c> means either <c>token1</c> or
 <c>token2</c>; <c>[token]</c> means either <c>token</c> or nothing;
-<c>{expression}</c> means the token resulting from the expression.
+<c>{expression}</c> means the token resulting from the expression.)
 }
 @EndParams
  
 Note that on compilers that support variadic macros, commas can be used to
 separate the declarations resembling more closely the usual C++ function
-declaration syntax.
-This is the preferred syntax.
+declaration syntax (this is the preferred syntax).
 However, for portability, on all C++ compilers (with and without variadic
 macros) the same library macros also accept parameter declarations specified as
 a Boost.Preprocessor sequence separated by round parenthesis <c>()</c>.
@@ -147,55 +151,154 @@
 Within the local function body it possible to access the result type using <c>result_type</c>, the type of the first parameter using <c>arg1_type</c>, the type of the second parameter using <c>arg2_type</c>, etc.
 The bound variable types can be accessed using @RefMacro{BOOST_LOCAL_FUNCTION_TYPEOF}.
 
+This macro cannot be portably expanded multiple times on the same line.
+In these cases, use the @RefMacro{BOOST_LOCAL_FUNCTION_ID} macro instead.
+
 The maximum number of local function parameters (excluding bound variables) is
 specified by the configuration macro
 @RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX}.
 The maximum number of bound variables is specified by the configuration macro
 @RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX}.
+The configuration macro
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS} can be used to force
+optimizations that reduce the local function call run-time overhead.
 
 @Note Local functions are functors so they can be assigned to other functors
 like <c>boost::function</c> (see Boost.Function).
 
-_at_Note This macro cannot be portably used multiple times on the same line
-(because on GCC and other compilers, it internally uses the line number
-<c>__LINE__</c> to generate unique identifiers).
-
-_at_See @RefSect{Tutorial} section,
-_at_RefSectId{Advanced_Topics, Advanced Topics} section,
-_at_RefMacro{BOOST_LOCAL_FUNCTION_TPL},
-_at_RefMacro{BOOST_LOCAL_FUNCTION_NAME},
-_at_RefMacro{BOOST_LOCAL_FUNCTION_TYPEOF},
+@See @RefSect{tutorial, Tutorial} section,
+@RefSect{advanced_topics, Advanced Topics} section,
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME}, @RefMacro{BOOST_LOCAL_FUNCTION_TPL},
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME_TPL},
+@RefMacro{BOOST_LOCAL_FUNCTION_TYPEOF}, @RefMacro{BOOST_LOCAL_FUNCTION_ID},
 @RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX},
-_at_RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX}.
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX},
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS}.
 */
 #define BOOST_LOCAL_FUNCTION(declarations)
 
 /**
-_at_brief This macro is used to start a local function declaration within templates.
+@brief This macro is used to start a local function declaration within
+templates.
 
-This macro must be used instead of @RefMacro{BOOST_LOCAL_FUNCTION} when declaring a local function within a template.
-A part from that, this macro has the exact same syntax as @RefMacro{BOOST_LOCAL_FUNCTION} (see @RefMacro{BOOST_LOCAL_FUNCTION} for more information):
+This macro must be used instead of @RefMacro{BOOST_LOCAL_FUNCTION} when
+declaring a local function within a template.
+A part from that, this macro has the exact same syntax a
+@RefMacro{BOOST_LOCAL_FUNCTION} (see @RefMacro{BOOST_LOCAL_FUNCTION} for more
+information):
 @code
-{ // Some declarative context with a template.
+{ // Some declarative context within a template.
     ...
     result_type BOOST_LOCAL_FUNCTION_TPL(declarations) {
         ... // Body code.
- } BOOST_LOCAL_FUNCTION_NAME(qualified_function_name)
+ } BOOST_LOCAL_FUNCTION_NAME_TPL(qualified_name)
     ...
 }
 @endcode
 
+Note that @RefMacro{BOOST_LOCAL_FUNCTION_NAME_TPL} must be used with this
+macro instead of @RefMacro{BOOST_LOCAL_FUNCTION_NAME}.
+
+This macro cannot be portably expanded multiple times on the same line.
+In these cases, use the @RefMacro{BOOST_LOCAL_FUNCTION_ID_TPL} macro instead.
+
 @Note C++03 does not allow to use <c>typename</c> outside templates.
 This library internally manipulates types, these operations require
-<c>typename</c> but only within templates so this macro is used to indicate to
-the library when the enclosing scope is a template.
-
-_at_See @RefSect{Tutorial} section, @RefMacro{BOOST_LOCAL_FUNCTION},
-_at_RefMacro{BOOST_LOCAL_FUNCTION_NAME}.
+<c>typename</c> but only within templates.
+This macro is used to indicate to the library when the enclosing scope is a
+template so the library can correctly use <c>typename</c>.
+
+@See @RefSect{tutorial, Tutorial} section, @RefMacro{BOOST_LOCAL_FUNCTION},
+@RefMacro{BOOST_LOCAL_FUNCTION_ID_TPL},
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME_TPL}.
 */
 #define BOOST_LOCAL_FUNCTION_TPL(declarations)
 
 /**
+@brief This macro allows to declare multiple local functions on the same line.
+
+This macro is equivalent to @RefMacro{BOOST_LOCAL_FUNCTION} but it can be
+expanded multiple times on the same line if different identifiers <c>id</c> are
+provided for each expansion (see the
+@RefSect{advanced_topics, Advanced Topics} section).
+
+@Params
+@Param{id,
+A unique identifier token which can be concatenated by the preprocessor
+(<c>__LINE__</c>\, <c>local_function_number_1_on_line_123</c>\, etc).
+}
+@Param{declarations,
+Same as the <c>declarations</c> parameter of the
+@RefMacro{BOOST_LOCAL_FUNCTION} macro.
+}
+@EndParams
+
+The @RefMacro{BOOST_LOCAL_FUNCTION_NAME} macro should be used to end each one
+of the multiple local function declarations as usual (and it will specify a
+unique name for each local function).
+
+Within templates, the special macros @RefMacro{BOOST_LOCAL_FUNCTION_ID_TPL}
+must be used.
+
+@Note This macro can be useful when the local function macros are expanded
+within user-defined macros (because macros all expand on the same line).
+On some compilers (e.g., MSVC which supports the non-standard
+<c>__COUNTER__</c> macro) it might not be necessary to use this macro but
+the use of this macro when expanding multiple local function macros on the same
+line is always necessary to ensure portability (this is because this library
+can only portably use <c>__LINE__</c> to internally generate unique
+identifiers).
+
+@See @RefSect{advanced_topics, Advanced Topics} section,
+@RefMacro{BOOST_LOCAL_FUNCTION}, @RefMacro{BOOST_LOCAL_FUNCTION_NAME},
+@RefMacro{BOOST_LOCAL_FUNCTION_ID_TPL}.
+*/
+#define BOOST_LOCAL_FUNCTION_ID(id, declarations)
+
+/**
+@brief This macro allows to declare multiple local functions on the same line
+within templates.
+
+This macro must be used instead of @RefMacro{BOOST_LOCAL_FUNCTION_TPL} when
+declaring multiple local functions on the same line within a template.
+A part from that, this macro has the exact same syntax as
+@RefMacro{BOOST_LOCAL_FUNCTION_TPL} (see @RefMacro{BOOST_LOCAL_FUNCTION_TPL}
+for more information).
+
+@Params
+@Param{id,
+A unique identifier token which can be concatenated by the preprocessor
+(<c>__LINE__</c>\, <c>local_function_number_1_on_line_123</c>\, etc).
+}
+@Param{declarations,
+Same as the <c>declarations</c> parameter of the
+@RefMacro{BOOST_LOCAL_FUNCTION_TPL} macro.
+}
+@EndParams
+
+The @RefMacro{BOOST_LOCAL_FUNCTION_NAME} macro should be used to end each one
+of the multiple local function declarations as usual (and it will specify a
+unique name for each local function).
+
+Outside template, the macro @RefMacro{BOOST_LOCAL_FUNCTION_ID} should be used
+to declare multiple local functions on the same line.
+
+@Note This macro can be useful when the local function macros are expanded
+within user-defined macros (because macros all expand on the same line).
+On some compilers (e.g., MSVC which supports the non-standard
+<c>__COUNTER__</c> macro) it might not be necessary to use this macro but
+the use of this macro when expanding multiple local function macros on the same
+line is always necessary to ensure portability (this is because this library
+can only portably use <c>__LINE__</c> to internally generate unique
+identifiers).
+
+@See @RefSect{advanced_topics, Advanced Topics} section,
+@RefMacro{BOOST_LOCAL_FUNCTION_TPL}, @RefMacro{BOOST_LOCAL_FUNCTION_NAME},
+@RefMacro{BOOST_LOCAL_FUNCTION_ID}.
+*/
+#define BOOST_LOCAL_FUNCTION_ID_TPL(id, declarations)
+
+/**
 @brief This macro is used to end a local function declaration specifying its
 name.
 
@@ -205,68 +308,115 @@
     ...
     result_type BOOST_LOCAL_FUNCTION(declarations) {
         ... // Body code.
- } BOOST_LOCAL_FUNCTION_NAME(qualified_function_name)
+ } BOOST_LOCAL_FUNCTION_NAME(qualified_name)
     ...
 }
 @endcode
 
+Within templates, the special macros @RefMacro{BOOST_LOCAL_FUNCTION_TPL} and
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME_TPL} must be used.
+
 @Params
-_at_Param{qualified_function_name,
+@Param{qualified_name,
 The name of the local function optionally qualified as follow:
 @code
-qualified_function_name:
- [inline] [recursive] name
+ name:
+ [inline] [recursive] local_function_name
 @endcode
-Lexical conventions: <c>token1 | token2</c> means either <c>token1</c> or
+(Lexical conventions: <c>token1 | token2</c> means either <c>token1</c> or
 <c>token2</c>; <c>[token]</c> means either <c>token</c> or nothing;
-<c>{expression}</c> means the token resulting from the expression.
+<c>{expression}</c> means the token resulting from the expression.)
 }
 @EndParams
 
 The local function name can be qualified by prefixing it with the keyword
-<c>inline</c> (see the @RefSectId{Advanced_Topics, Advanced Topics} section):
-<c>BOOST_LOCAL_FUNCTION_NAME(inline name)</c>.
+<c>inline</c> (see the @RefSect{advanced_topics, Advanced Topics} section):
+@code
+ BOOST_LOCAL_FUNCTION_NAME(inline local_function_name)
+@endcode
 This increases the chances that the compiler will be able to inline the local
 function calls (thus reducing run-time).
-However, inlined local functions cannot be passed as template parameters (e.g., to <c>std::for_each</c>) or assigned to other functors (e.g., to
+However, inline local functions cannot be passed as template parameters (e.g., to <c>std::for_each</c>) or assigned to other functors (e.g., to
 <c>boost::function</c>).
-That is true on C++03 compilers but inlined local functions can instead be
+That is true on C++03 compilers but inline local functions can instead be
 passed as template parameters on C++11 compilers.
 On C++11 compilers, there is no need to declare a local function lined because
 this library will automatically use C++11 specific features to inline the local
 function while always allowing to pass it as a template parameter.
+This optimization is automatically enabled when the Boost.Config macro
+<c>BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS</c> is not defined but it also be
+forced using @RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS}.
 
 The local function name can also be qualified by prefixing it with the
 "keyword" <c>recursive</c> (see the
-_at_RefSectId{Advanced_Topics, Advanced Topics} section):
-<c>BOOST_LOCAL_FUNCTION_NAME(recursive name)</c>.
+@RefSect{advanced_topics, Advanced Topics} section):
+@code
+ BOOST_LOCAL_FUNCTION_NAME(recursive local_function_name)
+@endcode
 This allows the local function to recursively call itself from its body (as
 usual in C++).
-However, compilers have not been observed to be able to inline recursive
-local function calls (not even when the recursive local function is also
-declared inline: <c>BOOST_LOCAL_FUNCTION(inline recursive name)</c>).
-Furthermore, recursive local functions should only be called within their
+However, recursive local functions should only be called within their
 declaration scope (otherwise the result is undefined behaviour).
+Finally, compilers have not been observed to be able to inline recursive local
+function calls, not even when the recursive local function is also declared
+inline:
+@code
+ BOOST_LOCAL_FUNCTION(inline recursive local_function_name)
+@endcode
 
 @Note The local function name cannot be the name of an operator
 <c>operator...</c> and it cannot be the same name of another local function
 declared within the same enclosing scope (but <c>boost::overloaded_function</c>
 can be used to overload local functions, see
 Boost.Functional/OverloadedFunction and the
-_at_RefSectId{Advanced_Topics, Advanced Topics} section).
+@RefSect{advanced_topics, Advanced Topics} section).
 
-_at_See @RefSect{Tutorial} section,
-_at_RefSectId{Advanced_Topics, Advanced Topics} section,
-_at_RefMacro{BOOST_LOCAL_FUNCTION}.
+@See @RefSect{tutorial, Tutorial} section,
+@RefSect{advanced_topics, Advanced Topics} section,
+@RefMacro{BOOST_LOCAL_FUNCTION},
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME_TPL}.
+*/
+#define BOOST_LOCAL_FUNCTION_NAME(qualified_name)
+
+/**
+@brief This macro is used to end a local function declaration specifying its
+name within templates.
+
+This macro must be used instead of @RefMacro{BOOST_LOCAL_FUNCTION_NAME} when
+declaring a local function within a template.
+A part from that, this macro has the exact same syntax a
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME} (see @RefMacro{BOOST_LOCAL_FUNCTION_NAME}
+for more information):
+@code
+{ // Some declarative context within a template.
+ ...
+ result_type BOOST_LOCAL_FUNCTION_TPL(declarations) {
+ ... // Body code.
+ } BOOST_LOCAL_FUNCTION_NAME_TPL(qualified_name)
+ ...
+}
+@endcode
+
+Note that @RefMacro{BOOST_LOCAL_FUNCTION_TPL} must be used with this macro
+instead of @RefMacro{BOOST_LOCAL_FUNCTION}.
+
+@Note C++03 does not allow to use <c>typename</c> outside templates.
+This library internally manipulates types, these operations require
+<c>typename</c> but only within templates.
+This macro is used to indicate to the library when the enclosing scope is a
+template so the library can correctly use <c>typename</c>.
+
+@See @RefSect{tutorial, Tutorial} section,
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME}, @RefMacro{BOOST_LOCAL_FUNCTION_TPL}.
 */
-#define BOOST_LOCAL_FUNCTION_NAME(qualified_function_name)
+#define BOOST_LOCAL_FUNCTION_NAME_TPL(name)
 
 /**
 @brief This macro expands to the type of the specified bound variable.
 
 This macro can be used within the local functions body to refer to the bound
 variable types so to declare local variables, check concepts (using
-Boost.ConceptCheck), etc (see the @RefSectId{Advanced_Topics, Advanced Topics}
+Boost.ConceptCheck), etc (see the @RefSect{advanced_topics, Advanced Topics}
 section).
 This way the local function can be programmed entirely without explicitly
 specifying the bound variable types thus facilitating maintenance (e.g., if
@@ -292,11 +442,13 @@
 @li Bound by constant reference using <c>const bind& t</c> then
 <c>BOOST_LOCAL_FUNCTION_TYPEOF(t)</c> is <c>const T&</c>.
 
-This macro must be prefixed by <c>typename</c> when used in a type dependant context.
+This macro must be prefixed by <c>typename</c> when used within templates.
 
-It is best to use this macro instead of Boost.Typeof so to reduce the number of times Boost.Typeof is used to deduce types (see the @RefSectId{Advanced_Topics, Advanced Topics} section).
+@Note It is best to use this macro instead of Boost.Typeof so to reduce the
+number of times Boost.Typeof is used to deduce types (see the
+@RefSect{advanced_topics, Advanced Topics} section).
 
-_at_See @RefSectId{Advanced_Topics, Advanced Topics} section,
+@See @RefSect{advanced_topics, Advanced Topics} section,
 @RefMacro{BOOST_LOCAL_FUNCTION}.
 */
 #define BOOST_LOCAL_FUNCTION_TYPEOF(bound_variable_name)

Deleted: /trunk/boost/local_function/aux_/config.hpp
==============================================================================
--- /trunk/boost/local_function/aux_/config.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,35 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/local_function
-
-#ifndef BOOST_LOCAL_FUNCTION_AUX_CONFIG_HPP_
-#define BOOST_LOCAL_FUNCTION_AUX_CONFIG_HPP_
-
-#include <boost/config.hpp>
-
-// PRIVATE //
-
-// FUTURE: Replace this with BOOST_NO_LOCAL_TYPES_AS_TEMPLATE_PARAMS after
-// that macro is added to Boost.Config.
-// If it is possible to pass local types (classes, etc) as template parameters.
-// This is not possible in pure C++03 but it is possible in some C++03
-// extensions (MSVC, GCC 4.5.x, etc).
-#if !((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)) && \
- defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(BOOST_MSVC)
- // Not GCC 4.5.x with -std=c++0x and not MSVC.
-# define BOOST_LOCAL_FUNCTION_AUX_CONFIG_NO_LOCAL_TYPES_AS_TEMPLATE_PARAMS
-#endif
-
-// PUBLIC //
-
-#ifdef BOOST_LOCAL_FUNCTION_AUX_CONFIG_NO_LOCAL_TYPES_AS_TEMPLATE_PARAMS
-# define BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01 0
-#else
-# define BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01 1
-#endif
-
-#endif // #include guard
-

Modified: branches/release/boost/local_function/aux_/function.hpp
==============================================================================
--- /trunk/boost/local_function/aux_/function.hpp (original)
+++ branches/release/boost/local_function/aux_/function.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -10,7 +10,6 @@
 # define BOOST_LOCAL_FUNCTION_AUX_FUNCTION_HPP_
 
 # include <boost/local_function/config.hpp>
-# include <boost/local_function/aux_/config.hpp>
 # include <boost/local_function/aux_/member.hpp>
 # include <boost/call_traits.hpp>
 # include <boost/typeof/typeof.hpp>
@@ -35,6 +34,9 @@
 #define BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC \
     BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (init_call) )
 
+#define BOOST_LOCAL_FUNCTION_AUX_typename_seq(z, n, unused) \
+ (typename)
+
 #define BOOST_LOCAL_FUNCTION_AUX_arg_type(z, arg_n, unused) \
     BOOST_PP_CAT(A, arg_n)
 
@@ -111,7 +113,7 @@
 #define BOOST_LOCAL_FUNCTION_AUX_call_typedef(z, n, arity) \
     typedef R (*BOOST_LOCAL_FUNCTION_AUX_call_ptr(z, n, ~))( \
         object_ptr \
- BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01, \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS, \
             BOOST_PP_TUPLE_EAT(3) \
         , \
             BOOST_PP_REPEAT_ ## z \
@@ -150,7 +152,7 @@
         return BOOST_LOCAL_FUNCTION_AUX_call_member(z, defaults_n, ~)( \
             object_ \
             BOOST_PP_IIF( \
- BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01,\
+ BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,\
                 BOOST_PP_TUPLE_EAT(3) \
             , \
                 BOOST_PP_REPEAT_ ## z \
@@ -166,7 +168,7 @@
 template<
       typename F
     , size_t defaults
-#if !BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01
+#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
     BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
             BOOST_LOCAL_FUNCTION_AUX_comma_bind_tparam, ~)
 #endif
@@ -184,15 +186,18 @@
 // Register type for type-of emu (NAME use TYPEOF to deduce this fctor type).
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::local_function::aux::function,
- BOOST_PP_ADD(2, // F and defaults tparams.
- BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01,
- 0 // No additional tparam.
- ,
- BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX // Bind tparams.
- )
- )
+ (typename) // For `F` tparam.
+ (size_t) // For `defaults` tparam.
+ // MSVC error if using #if instead of PP_IIF here.
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,
+ BOOST_PP_TUPLE_EAT(3) // Nothing.
+ ,
+ BOOST_PP_REPEAT // For bind tparams.
+ )(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
+ BOOST_LOCAL_FUNCTION_AUX_typename_seq, ~)
 )
 
+#undef BOOST_LOCAL_FUNCTION_AUX_typename_seq
 #undef BOOST_LOCAL_FUNCTION_AUX_arg_type
 #undef BOOST_LOCAL_FUNCTION_AUX_arg_typedef
 #undef BOOST_LOCAL_FUNCTION_AUX_comma_arg_tparam
@@ -235,7 +240,7 @@
     typename R
     BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_AUX_arity,
             BOOST_LOCAL_FUNCTION_AUX_comma_arg_tparam, ~)
-#if !BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01
+#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
     BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
             BOOST_LOCAL_FUNCTION_AUX_comma_bind_tparam, ~)
 #endif
@@ -246,7 +251,7 @@
                 BOOST_LOCAL_FUNCTION_AUX_arg_type, ~)
       )
     , BOOST_LOCAL_FUNCTION_AUX_defaults
-#if !BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01
+#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
     BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
             BOOST_LOCAL_FUNCTION_AUX_comma_bind_type, ~)
 #endif
@@ -282,7 +287,7 @@
     // so used internal symbol.
     inline void BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC(
         object_ptr object
-#if !BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01
+#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
         BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
                 BOOST_LOCAL_FUNCTION_AUX_comma_bind_param_decl, ~)
 #endif
@@ -290,7 +295,7 @@
                 BOOST_LOCAL_FUNCTION_AUX_comma_call_param_decl, ~)
     ) {
         object_ = object;
-#if !BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01
+#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
         BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
                 BOOST_LOCAL_FUNCTION_AUX_bind_member_init, ~)
 #endif
@@ -308,7 +313,7 @@
 
 private:
     object_ptr object_;
-#if !BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01
+#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
     BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
             BOOST_LOCAL_FUNCTION_AUX_bind_member_decl, ~)
 #endif

Modified: branches/release/boost/local_function/aux_/macro/code_/bind.hpp
==============================================================================
--- /trunk/boost/local_function/aux_/macro/code_/bind.hpp (original)
+++ branches/release/boost/local_function/aux_/macro/code_/bind.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -64,11 +64,7 @@
                 id \
             , \
                 /* ScopeExit expects typename or EMPTY() here */ \
- BOOST_PP_IIF(typename01, \
- BOOST_PP_IDENTITY(typename) \
- , \
- BOOST_PP_EMPTY \
- )() \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
             ), \
             i, BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
                     bind_traits))
@@ -90,11 +86,9 @@
                 BOOST_PP_TUPLE_ELEM(2, 0, id_typename) \
             , \
                 /* ScopeExit expects typename or EMPTY() here */ \
- BOOST_PP_IIF(BOOST_PP_TUPLE_ELEM(2, 1, id_typename), \
- BOOST_PP_IDENTITY(typename) \
- , \
- BOOST_PP_EMPTY \
- )() \
+ BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(2, 1, id_typename), \
+ typename \
+ ) \
             ), \
             i, BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
                     bind_traits))
@@ -123,21 +117,28 @@
             BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
                     bind_traits))
 
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_CAPTURE_TYPE_(id) \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (this_capture_type)(id) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE_(id) \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (this_type)(id) )
+
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPEDEF_DEDUCED_( \
- id, all_bind_this_types) \
+ id, typename01, all_bind_this_types) \
     BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS(id, \
- BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id))
+ BOOST_PP_EXPR_IIF(typename01, typename), /* otherwise EMPTY() */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_CAPTURE_TYPE_(id))
 
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPEDEF_TYPED_( \
- id, all_bind_this_types) \
+ id, typename01, all_bind_this_types) \
     typedef \
         BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_THIS_TYPE(BOOST_PP_LIST_FIRST( \
                 all_bind_this_types)) \
- BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_CAPTURE_TYPE_(id) \
     ;
     
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPEDEF_( \
- id, all_bind_this_types) \
+ id, typename01, all_bind_this_types) \
     /* typedef type_ */ \
     BOOST_PP_IIF(BOOST_PP_IS_EMPTY( \
             /* all_bind_this_type is list with 1 elem (possibly PP_EMPTY), */ \
@@ -147,7 +148,7 @@
         BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPEDEF_DEDUCED_ \
     , \
         BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPEDEF_TYPED_ \
- )(id, all_bind_this_types)
+ )(id, typename01, all_bind_this_types)
 
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_ALL_( \
         all_binds, all_bind_this_types, id, typename01) \
@@ -155,16 +156,21 @@
     BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
         BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPEDEF_ \
     , \
- BOOST_PP_TUPLE_EAT(2) \
- )(id, all_bind_this_types) \
+ BOOST_PP_TUPLE_EAT(3) \
+ )(id, typename01, all_bind_this_types) \
     BOOST_PP_LIST_FOR_EACH_I(BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_TAG_DECL_, id, \
             all_binds) \
     BOOST_PP_LIST_FOR_EACH_I(BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_CAPTURE_DECL_, \
             (id, typename01), all_binds) \
     /* binding class */ \
     struct BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id) { \
+ /* interim capture types to workaround internal error on old GCC */ \
         BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
- BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id) \
+ typedef BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_CAPTURE_TYPE_(id) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE_(id) ; \
+ ) \
+ BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE_(id) \
             BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_VAR; \
         ) \
         BOOST_PP_LIST_FOR_EACH_I( \
@@ -207,8 +213,10 @@
 
 // PUBLIC //
 
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id) \
- BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (this_type)(id) )
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01) \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id):: \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE_(id)
 
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_VAR \
     BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (this_var) )

Deleted: /trunk/boost/local_function/aux_/macro/code_/end.hpp
==============================================================================
--- /trunk/boost/local_function/aux_/macro/code_/end.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,97 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/local_function
-
-#ifndef BOOST_CLOSURE_AUX_CODE_END_HPP_
-#define BOOST_CLOSURE_AUX_CODE_END_HPP_
-
-#include <boost/closure/aux_/symbol.hpp>
-#include <boost/closure/aux_/config.hpp>
-#include <boost/closure/aux_/function.hpp>
-#include <boost/closure/aux_/macro/closure.hpp>
-#include <boost/closure/aux_/macro/code_/functor.hpp>
-#include <boost/closure/detail/preprocessor/keyword/inline.hpp>
-#include <boost/typeof/typeof.hpp>
-#include <boost/preprocessor/logical/bitor.hpp>
-#include <boost/preprocessor/control/iif.hpp>
-
-// PRIVATE //
-
-#define BOOST_CLOSURE_AUX_CODE_END_FUNCTOR_PTR_ \
- BOOST_CLOSURE_AUX_SYMBOL( (functor_ptr) )
-
-#define BOOST_CLOSURE_AUX_CODE_END_FUNCTOR_(id, \
- local_function_name, local_functor_name, nonlocal_functor_name) \
- /* `PARAMS() { ... }` expandsion here -- still within functor class */ \
- /* class functor ## __LINE__ { ... */ \
- public: \
- /* LIMITATION: member var used to deduce functor type using TYPEOF */ \
- /* (so it must be public, ptr to always allow for default init); */ \
- /* unfortunately, this introduces a dependency with Boost.Typeof */ \
- /* that cannot be removed even when all binds and result types are */ \
- /* explicitly specified but this is necessary because the functor */ \
- /* type is known to the CLOSURE macro which must pass it to the */ \
- /* END macro that is defined on a different line */ \
- BOOST_CLOSURE_AUX_CODE_FUNCTOR_TYPE* \
- BOOST_CLOSURE_AUX_CODE_END_FUNCTOR_PTR_; \
- /* local functor can be passed as tparam only on C++11 (faster) */ \
- } local_functor_name(BOOST_CLOSURE_AUX_CLOSURE_ARGS_VAR.value); \
- /* non-local functor can always be passed as tparam (but slower) */ \
- BOOST_TYPEOF(*(local_functor_name.BOOST_CLOSURE_AUX_CODE_END_FUNCTOR_PTR_))\
- nonlocal_functor_name; \
- /* initialization */ \
- local_functor_name.BOOST_CLOSURE_AUX_FUNCTION_INIT_CALL_FUNC( \
- &local_functor_name, nonlocal_functor_name);
-
-#define BOOST_CLOSURE_AUX_CODE_END_FUNCTOR_VAR_(local_function_name) \
- BOOST_CLOSURE_AUX_SYMBOL( (local_function_name) )
-
-// This can always be passed as a template parameters (on all compilers).
-// However, it is slower because it cannot be inlined.
-// Passed at tparam: Yes (on all C++). Inlineable: No. Recursive: No.
-#define BOOST_CLOSURE_AUX_CODE_END_(local_function_name) \
- BOOST_CLOSURE_AUX_CODE_END_FUNCTOR_(__LINE__, local_function_name, \
- /* local functor */ \
- BOOST_CLOSURE_AUX_CODE_END_FUNCTOR_VAR_(local_function_name), \
- /* local function declared as non-local functor -- but it can */ \
- /* be inlined only by C++11 and it cannot be recursive */ \
- local_function_name)
-
-// This is faster on some compilers but not all (e.g., it is faster on GCC
-// because its optimization inlines it but not on MSVC). However, it cannot be
-// passed as a template parameter on non C++11 compilers.
-// Passed at tparam: Only on C++11. Inlineable: Yes. Recursive: No.
-#define BOOST_CLOSURE_AUX_CODE_END_INLINE_(local_function_name) \
- BOOST_CLOSURE_AUX_CODE_END_FUNCTOR_(__LINE__, local_function_name, \
- /* inlined local function declared as local functor (maybe */ \
- /* inlined even by non C++11 -- but it can be passed as */ \
- /* template parameter only on C++11 */ \
- local_function_name, \
- /* non-local functor */ \
- BOOST_CLOSURE_AUX_CODE_END_FUNCTOR_VAR_(local_function_name))
-
-// PUBLIC //
-
-// Inlined local functions are specified by `..._NAME(inline name)`.
-// They have more chances to be inlined for faster run-times by some compilers
-// (for example by GCC but not by MSVC). C++11 compilers can always inline
-// local functions even if they are not explicitly specified inline.
-#define BOOST_CLOSURE_AUX_CODE_END(qualified_name) \
- BOOST_PP_IIF(BOOST_PP_BITOR( \
- BOOST_CLOSURE_AUX_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01, \
- BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_INLINE_FRONT(qualified_name)), \
- /* on C++11 always use inlining because compilers might optimize */ \
- /* it to be faster and it can also be passed as tparam */ \
- BOOST_CLOSURE_AUX_CODE_END_INLINE_ \
- , \
- /* on non C++11 don't use liniling unless explicitly specified by */ \
- /* programmers `inline name` the inlined local function cannot be */ \
- /* passed as tparam */ \
- BOOST_CLOSURE_AUX_CODE_END_ \
- )(BOOST_CLOSURE_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT(qualified_name))
-
-#endif // #include guard
-

Modified: branches/release/boost/local_function/aux_/macro/code_/functor.hpp
==============================================================================
--- /trunk/boost/local_function/aux_/macro/code_/functor.hpp (original)
+++ branches/release/boost/local_function/aux_/macro/code_/functor.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -8,8 +8,8 @@
 #ifndef BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_HPP_
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_HPP_
 
+#include <boost/local_function/config.hpp>
 #include <boost/local_function/aux_/symbol.hpp>
-#include <boost/local_function/aux_/config.hpp>
 #include <boost/local_function/aux_/function.hpp>
 #include <boost/local_function/aux_/add_pointed_const.hpp>
 #include <boost/local_function/aux_/member.hpp>
@@ -237,14 +237,16 @@
       BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_( \
             BOOST_PP_TUPLE_ELEM(4, 2, id_typename_offset_const), i)
 
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_TYPE_(id) \
- , BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id)
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_TYPE_( \
+ id, typename01) \
+ , BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01)
       
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_THIS_PARAM_ \
     bind_this
 
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_PARAM_DECL_(id) \
- , BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id) & \
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_PARAM_DECL_( \
+ id, typename01) \
+ , BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01) & \
       BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_THIS_PARAM_
 
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_NOBIND_(z, n, unused) \
@@ -323,8 +325,8 @@
 
 // Expand to the function type `R (A1, ...)`.
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_( \
- id, decl_traits, has_type, function_type) \
- BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id) \
+ id, typename01, decl_traits, has_type, function_type) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
     BOOST_PP_EXPR_IIF(has_type, (function_type) ) \
     ( \
         BOOST_PP_LIST_FOR_EACH_I( \
@@ -383,7 +385,8 @@
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_(z, defaults_n, \
         id, typename01, decl_traits, params, \
         const_binds, has_const_bind_this, binds, has_bind_this) \
- inline BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id) operator()( \
+ inline BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
+ operator()( \
         BOOST_PP_LIST_FOR_EACH_I( \
                 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_ENUM_, \
                 typename01, params) \
@@ -423,8 +426,8 @@
             has_const_bind_this), \
         BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_PARAM_DECL_ \
     , \
- BOOST_PP_TUPLE_EAT(1) \
- )(id) \
+ BOOST_PP_TUPLE_EAT(2) \
+ )(id, typename01) \
     /* fill with nobind_t (if no local-types as tparams) */ \
     BOOST_PP_REPEAT(BOOST_PP_SUB(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX, \
             BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, \
@@ -459,10 +462,10 @@
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_(z, defaults_n, \
         id, typename01, decl_traits, params, \
         const_binds, has_const_bind_this, binds, has_bind_this) \
- inline static BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id) \
+ inline static BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
     BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_(z, defaults_n, ~)( \
         void* object \
- BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01, \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS, \
             BOOST_PP_TUPLE_EAT(6) \
         , \
   BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_COMMA_BIND_PARAM_DECLS_ \
@@ -484,7 +487,7 @@
             static_cast< \
                 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_(id)* \
>(object)-> \
- BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01,\
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,\
                 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_OPERATOR_ \
             , \
                 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_BODY_ \
@@ -541,8 +544,8 @@
             has_const_bind_this), \
         BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_TYPE_ \
     , \
- BOOST_PP_TUPLE_EAT(1) \
- )(id) \
+ BOOST_PP_TUPLE_EAT(2) \
+ )(id, typename01) \
     /* fill with nobind_t (if no local-types as tparams) */ \
     BOOST_PP_REPEAT(BOOST_PP_SUB(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX, \
             BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, has_const_bind_this), \
@@ -575,7 +578,7 @@
         typedef BOOST_LOCAL_FUNCTION_AUX_TYPEOF_TYPE( \
             BOOST_PP_EXPR_IIF(typename01, typename) \
             ::boost::local_function::aux::add_pointed_const< \
- BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01) \
>::type \
             this_ \
         ) ; /* close typedef */ \
@@ -583,7 +586,7 @@
     /* ... or, non-const this */ \
     BOOST_PP_EXPR_IIF(has_bind_this, \
         typedef BOOST_LOCAL_FUNCTION_AUX_TYPEOF_TYPE( \
- BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01) \
             this_ \
         ) ; /* close typedef */ \
     )
@@ -605,8 +608,9 @@
     /* bind this const or not (pointed-const is not added here because */ \
     /* this is a reference, it is added to the this_ body param instead */ \
     BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(has_bind_this, has_const_bind_this), \
- BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id)/* this is * so no & */\
- BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
+ /* this is * so no & */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
         ; /* end member variable declaration */ \
     )
 
@@ -683,25 +687,27 @@
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_( \
         id, typename01, decl_traits, params, \
         default_count, const_binds, has_const_bind_this, binds, has_bind_this) \
- class BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_(id) \
+ typedef class BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_(id) \
     /* run-time: do not use base class to allow for compiler optimizations */ \
     { \
         /* function type */ \
+ private: \
         typedef \
- BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_(id, decl_traits, \
- 1 /* has type */, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_(id, typename01, \
+ decl_traits, 1 /* has type */, \
                     BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_TYPE_) \
         ; \
         /* functor type -- this type cannot have ID postfix because it is */ \
         /* used the `NAME` macro (this symbol is within functor class so */ \
- /* it does not have to have ID postfix) */ \
+ /* it does not have to have ID postfix), must be public so it */ \
+ /* can be accessed by `NAME` macro from outside this class */ \
+ public: \
         typedef BOOST_PP_EXPR_IIF(typename01, typename) \
             BOOST_IDENTITY_TYPE(( /* IDENTITY for template param comma */ \
                 ::boost::local_function::aux::function< \
                       BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_TYPE_ \
                     , default_count \
- BOOST_PP_IIF( \
- BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01, \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,\
                         BOOST_PP_TUPLE_EAT(6) \
                     , \
                         BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_TYPES_\
@@ -711,6 +717,7 @@
             )) \
             BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE \
         ; \
+ private: \
         BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_TYPEOF_TYPEDEFS_( \
                 id, typename01, \
                 const_binds, has_const_bind_this, binds, has_bind_this) \
@@ -719,7 +726,8 @@
         /* (traits must be defined in both this and the global functor) */ \
         enum { arity = ::boost::function_traits< /* can't use static data */ \
                 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_TYPE_ >::arity }; \
- typedef BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id) result_type; \
+ typedef BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
+ result_type; \
         BOOST_PP_LIST_FOR_EACH_I( \
                 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_ARG_TYPEDEF_, \
                 typename01, params) \
@@ -764,8 +772,7 @@
         ) { \
             functor.BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC( \
                     object \
- BOOST_PP_IIF( \
- BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01, \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,\
                         BOOST_PP_TUPLE_EAT(6) \
                     , \
   BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_STATIC_BINDS_ \
@@ -790,7 +797,7 @@
         /* body function (unfortunately, cannot be static to allow access */ \
         /* to member var with local function name for recursion but doing */ \
         /* so also allows the body to misuse `this` instead of `this_`) */ \
- inline BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id) \
+ inline BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
         BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BODY_FUNC_( \
                 /* const binds */ \
                 BOOST_PP_LIST_FOR_EACH_I( \
@@ -823,14 +830,16 @@
                 BOOST_PP_EXPR_IIF(has_const_bind_this, \
                     BOOST_PP_EXPR_IIF(typename01, typename) \
                     ::boost::local_function::aux::add_pointed_const< \
- BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id) \
- >::type const \
- this_ /* special name to access object this */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, \
+ typename01) \
+ >::type \
+ const this_ /* special name to access object this */ \
                 ) \
                 /* const pointer to non-const object */ \
                 BOOST_PP_EXPR_IIF(has_bind_this, \
- BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id) const \
- this_ /* special name to access object this */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, \
+ typename01) \
+ const this_ /* special name to access object this */ \
                 ) \
                 /* params (last because they can have defaults) */ \
                 BOOST_PP_COMMA_IF( \

Deleted: /trunk/boost/local_function/aux_/macro/code_/name.hpp
==============================================================================
--- /trunk/boost/local_function/aux_/macro/code_/name.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,103 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/local_function
-
-#ifndef BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_HPP_
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_HPP_
-
-#include <boost/local_function/aux_/symbol.hpp>
-#include <boost/local_function/aux_/config.hpp>
-#include <boost/local_function/aux_/function.hpp>
-#include <boost/local_function/aux_/macro/decl.hpp>
-#include <boost/local_function/aux_/macro/code_/functor.hpp>
-#include <boost/local_function/detail/preprocessor/keyword/inline.hpp>
-#include <boost/typeof/typeof.hpp>
-#include <boost/preprocessor/logical/bitor.hpp>
-#include <boost/preprocessor/control/iif.hpp>
-
-// PRIVATE //
-
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_FUNCTOR_PTR_ \
- BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (functor_ptr) )
-
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_FUNCTOR_(id, \
- local_function_name, local_functor_name, nonlocal_functor_name) \
- /* `PARAMS() { ... }` expandsion here -- still within functor class */ \
- /* class functor ## __LINE__ { ... */ \
- public: \
- /* LIMITATION: member var used to deduce functor type using TYPEOF */ \
- /* (so it must be public, ptr to always allow for default init); */ \
- /* unfortunately, this introduces a dependency with Boost.Typeof */ \
- /* that cannot be removed even when all binds and result types are */ \
- /* explicitly specified but this is necessary because the functor */ \
- /* type is known to the LOCAL_FUNCTION macro which must pass it to */ \
- /* the NAME macro that is defined on a different line */ \
- BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE* \
- BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_FUNCTOR_PTR_; \
- /* local functor can be passed as tparam only on C++11 (faster) */ \
- } local_functor_name( \
- BOOST_LOCAL_FUNCTION_AUX_DECL_ARGS_VAR.value); \
- /* non-local functor can always be passed as tparam (but slower) */ \
- BOOST_TYPEOF(*(local_functor_name. \
- BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_FUNCTOR_PTR_)) \
- nonlocal_functor_name; \
- /* initialization */ \
- local_functor_name.BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC( \
- &local_functor_name, nonlocal_functor_name);
-
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_FUNCTOR_VAR_(local_function_name) \
- BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (local_function_name) )
-
-// This can always be passed as a template parameters (on all compilers).
-// However, it is slower because it cannot be inlined.
-// Passed at tparam: Yes (on all C++). Inlineable: No. Recursive: No.
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_(local_function_name) \
- BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_FUNCTOR_(__LINE__, local_function_name, \
- /* local functor */ \
- BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_FUNCTOR_VAR_( \
- local_function_name), \
- /* local function declared as non-local functor -- but it can */ \
- /* be inlined only by C++11 and it cannot be recursive */ \
- local_function_name)
-
-// This is faster on some compilers but not all (e.g., it is faster on GCC
-// because its optimization inlines it but not on MSVC). However, it cannot be
-// passed as a template parameter on non C++11 compilers.
-// Passed at tparam: Only on C++11. Inlineable: Yes. Recursive: No.
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_INLINE_(local_function_name) \
- BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_FUNCTOR_(__LINE__, local_function_name, \
- /* inlined local function declared as local functor (maybe */ \
- /* inlined even by non C++11 -- but it can be passed as */ \
- /* template parameter only on C++11 */ \
- local_function_name, \
- /* non-local functor */ \
- BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_FUNCTOR_VAR_( \
- local_function_name))
-
-// PUBLIC //
-
-// Inlined local functions are specified by `..._NAME(inline name)`.
-// They have more chances to be inlined for faster run-times by some compilers
-// (for example by GCC but not by MSVC). C++11 compilers can always inline
-// local functions even if they are not explicitly specified inline.
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_NAME(qualified_name) \
- BOOST_PP_IIF(BOOST_PP_BITOR( \
- BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01, \
- BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_INLINE_FRONT( \
- qualified_name)), \
- /* on C++11 always use inlining because compilers might optimize */ \
- /* it to be faster and it can also be passed as tparam */ \
- BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_INLINE_ \
- , \
- /* on non C++11 don't use liniling unless explicitly specified by */ \
- /* programmers `inline name` the inlined local function cannot be */ \
- /* passed as tparam */ \
- BOOST_LOCAL_FUNCTION_AUX_CODE_NAME_ \
- )(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT( \
- qualified_name))
-
-#endif // #include guard
-

Modified: branches/release/boost/local_function/aux_/macro/code_/result.hpp
==============================================================================
--- /trunk/boost/local_function/aux_/macro/code_/result.hpp (original)
+++ branches/release/boost/local_function/aux_/macro/code_/result.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -21,86 +21,76 @@
 
 // PRIVATE //
 
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TAG_(id) \
- BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (deduce_result_tag)(id) )
-
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_(id) \
     /* symbol (not internal) also gives error if missing result type */ \
     BOOST_PP_CAT( \
   ERROR_missing_result_type_before_the_local_function_parameter_macro_id, \
             id)
 
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_WRAP_(id) \
- BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (deduce_result_wrap)(id) )
-
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_CAPTURE_(id) \
- BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (deduce_result_capture)(id) )
-
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_PARAMS_(id) \
     BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (deduce_result_params)(id) )
 
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_TYPE_(id) \
- BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (deduce_result_function_type)(id) )
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE_(id) \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (result_type)(id) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_INDEX_ \
+ /* this does not have to be an integral index because ScopeExit uses */ \
+ /* just as a symbol to concatenate go generate unique symbols (but */ \
+ /* if it'd ever needed to became integral, the number of function */ \
+ /* params + 1 as in the macro CONFIG_ARITY_MAX could be used) */ \
+ result
 
 // User did not explicitly specified result type, deduce it (using Typeof).
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_DEDUCE_( \
         id, typename01, decl_traits) \
+ /* user specified result type here */ \
     BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_DECL(id) \
- /* the many tagging, wrapping, etc that follow are taken from ScopeExit */ \
- /* type deduction mechanism and they are necessary within templates */ \
- /* (at least on GCC) to work around an compiler internal error */ \
- typedef \
- void (*BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TAG_(id))( \
- int BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_(id) \
- ) \
- ; \
- typedef \
- BOOST_PP_IIF(typename01, BOOST_TYPEOF_TPL, BOOST_TYPEOF)( \
- ::boost::scope_exit::detail::wrap( \
- ::boost::scope_exit::detail::deref( \
- BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_(id), \
- (BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TAG_(id))0 \
- ) \
- ) \
- ) \
- BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_WRAP_(id) \
- ; \
- typedef BOOST_PP_EXPR_IIF(typename01, typename) \
- BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_WRAP_(id)::type \
- BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_CAPTURE_(id) \
- ; \
+ /* tagging, wrapping, etc as from ScopeExit type deduction are */ \
+ /* necessary within templates (at least on GCC) to work around an */ \
+ /* compiler internal errors) */ \
+ BOOST_SCOPE_EXIT_DETAIL_TAG_DECL(0, /* no recursive step r */ \
+ id, BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_INDEX_, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_(id)) \
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL(0, /* no recursive step r */ \
+ ( id, BOOST_PP_EXPR_IIF(typename01, typename) ), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_INDEX_, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_(id)) \
+ /* extra struct to workaround GCC and other compiler's issues */ \
     struct BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_PARAMS_(id) { \
- /* this typedef is internal to struct so its name will not clash */ \
- typedef BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_CAPTURE_(id) \
- function_ptr; \
- }; \
- typedef BOOST_PP_EXPR_IIF(typename01, typename) \
- ::boost::remove_pointer< BOOST_PP_EXPR_IIF(typename01, typename) \
- BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_PARAMS_(id)::function_ptr \
- >::type \
- BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_TYPE_(id) \
- ; \
- typedef BOOST_PP_EXPR_IIF(typename01, typename) \
- ::boost::function_traits< \
- BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_TYPE_(id) \
- >::result_type \
- BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id) \
- ;
+ typedef \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ ::boost::function_traits< \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ ::boost::remove_pointer< \
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(id, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_INDEX_, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_(id)) \
+ >::type \
+ >::result_type \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE_(id) \
+ ; \
+ };
 
 // Use result type as explicitly specified by user (no type deduction needed).
 // Precondition: RETURNS(decl_traits) != NIL
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPED_( \
         id, typename01, decl_traits) \
- typedef \
- BOOST_PP_LIST_FIRST(BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS( \
- decl_traits)) \
- BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id) \
- ;
+ /* user specified result type here */ \
+ struct BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_PARAMS_(id) { \
+ typedef \
+ BOOST_PP_LIST_FIRST( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS( \
+ decl_traits)) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE_(id) \
+ ; \
+ };
 
 // PUBLIC //
 
-#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id) \
- BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (result_type)(id) )
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_PARAMS_(id) :: \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE_(id)
 
 #define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_DECL(id) \
     /* result type here */ (*BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_(id))();

Modified: branches/release/boost/local_function/aux_/macro/name.hpp
==============================================================================
--- /trunk/boost/local_function/aux_/macro/name.hpp (original)
+++ branches/release/boost/local_function/aux_/macro/name.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -8,14 +8,13 @@
 #ifndef BOOST_LOCAL_FUNCTION_AUX_NAME_HPP_
 #define BOOST_LOCAL_FUNCTION_AUX_NAME_HPP_
 
+#include <boost/local_function/config.hpp>
 #include <boost/local_function/aux_/macro/decl.hpp>
 #include <boost/local_function/aux_/macro/code_/functor.hpp>
 #include <boost/local_function/detail/preprocessor/keyword/recursive.hpp>
 #include <boost/local_function/detail/preprocessor/keyword/inline.hpp>
 #include <boost/local_function/aux_/function.hpp>
 #include <boost/local_function/aux_/symbol.hpp>
-#include <boost/local_function/aux_/config.hpp>
-#include <boost/typeof/typeof.hpp>
 #include <boost/preprocessor/control/iif.hpp>
 #include <boost/preprocessor/control/expr_iif.hpp>
 #include <boost/preprocessor/logical/bitor.hpp>
@@ -23,6 +22,9 @@
 
 // PRIVATE //
 
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_LOCAL_TYPE_(local_function_name) \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (local_type)(local_function_name) )
+
 #define BOOST_LOCAL_FUNCTION_AUX_NAME_INIT_RECURSION_FUNC_ \
     BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (init_recursion) )
 
@@ -34,40 +36,40 @@
         BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (nonrecursive_local_function_name) ) \
     )
 
-#define BOOST_LOCAL_FUNCTION_AUX_NAME_END_LOCAL_FUNCTOR_(id, \
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_END_LOCAL_FUNCTOR_(typename01, \
         local_function_name, is_recursive, \
         local_functor_name, nonlocal_functor_name) \
- /* `PARAMS() { ... }` expandsion here -- still within functor class */ \
- /* class functor ## __LINE__ { ... */ \
- public: \
- /* member var with function name for recursive calls; must be */ \
- /* `public` because is it also used by this macro but outside */ \
- /* the functor class to deduce the functor type; it cannot be */ \
+ /* FUNCTION macro expanded to: typedef class functor ## __LINE__ { ... */ \
+ BOOST_PP_EXPR_IIF(is_recursive, \
+ /* member var with function name for recursive calls; it cannot be */ \
         /* `const` because it is init after construction (because */ \
         /* constructor doesn't know local function name) */ \
         /* run-time: even when optimizing, recursive calls cannot be */ \
         /* optimized (i.e., they must be via the non-local functor) */ \
         /* because this cannot be a mem ref because its name is not known */ \
         /* by the constructor so it cannot be set by the mem init list */ \
+ private: \
         BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE \
                 BOOST_LOCAL_FUNCTION_AUX_NAME_RECURSIVE_FUNC_(is_recursive, \
                         local_function_name); \
- BOOST_PP_EXPR_IIF(is_recursive, \
- /* run-time: the `init_recursion()` function cannot be called */ \
- /* by the constructor to allow for compiler optimization */ \
- /* (inlining) so it must be public */ \
- inline void BOOST_LOCAL_FUNCTION_AUX_NAME_INIT_RECURSION_FUNC_( \
- BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE& functor) { \
- local_function_name = functor; \
- } \
- ) \
+ /* run-time: the `init_recursion()` function cannot be called */ \
+ /* by the constructor to allow for compiler optimization */ \
+ /* (inlining) so it must be public to be called (see below) */ \
+ public: \
+ inline void BOOST_LOCAL_FUNCTION_AUX_NAME_INIT_RECURSION_FUNC_( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE& functor) { \
+ local_function_name = functor; \
+ } \
+ ) \
+ } BOOST_LOCAL_FUNCTION_AUX_NAME_LOCAL_TYPE_(local_function_name); \
     /* local functor can be passed as tparam only on C++11 (faster) */ \
- } local_functor_name(BOOST_LOCAL_FUNCTION_AUX_DECL_ARGS_VAR.value); \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_LOCAL_TYPE_(local_function_name) \
+ local_functor_name(BOOST_LOCAL_FUNCTION_AUX_DECL_ARGS_VAR.value); \
     /* non-local functor can always be passed as tparam (but slower) */ \
- BOOST_TYPEOF(local_functor_name. \
- BOOST_LOCAL_FUNCTION_AUX_NAME_RECURSIVE_FUNC_(is_recursive, \
- local_function_name)) \
- nonlocal_functor_name; \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_LOCAL_TYPE_(local_function_name):: \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE \
+ nonlocal_functor_name; /* functor variable */ \
     /* the order of the following 2 function calls cannot be changed */ \
     /* because init_recursion uses the local_functor so the local_functor */ \
     /* must be init first */ \
@@ -87,8 +89,8 @@
 // This can always be passed as a template parameters (on all compilers).
 // However, it is slower because it cannot be inlined.
 // Passed at tparam: Yes (on all C++). Inlineable: No. Recursive: No.
-#define BOOST_LOCAL_FUNCTION_AUX_NAME_(local_function_name) \
- BOOST_LOCAL_FUNCTION_AUX_NAME_END_LOCAL_FUNCTOR_(__LINE__, \
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_(typename01, local_function_name) \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_END_LOCAL_FUNCTOR_(typename01, \
             local_function_name, \
             /* local function is not recursive (because recursion and its */ \
             /* initialization cannot be inlined even on C++11, */ \
@@ -104,8 +106,8 @@
 // because its optimization inlines it but not on MSVC). However, it cannot be
 // passed as a template parameter on non C++11 compilers.
 // Passed at tparam: Only on C++11. Inlineable: Yes. Recursive: No.
-#define BOOST_LOCAL_FUNCTION_AUX_NAME_INLINE_(local_function_name) \
- BOOST_LOCAL_FUNCTION_AUX_NAME_END_LOCAL_FUNCTOR_(__LINE__, \
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_INLINE_(typename01, local_function_name) \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_END_LOCAL_FUNCTOR_(typename01, \
             local_function_name, \
             /* inlined local function is never recursive (because recursion */ \
             /* and its initialization cannot be inlined)*/ \
@@ -120,8 +122,9 @@
 // This is slower on all compilers (C++11 and non) because recursion and its
 // initialization can never be inlined.
 // Passed at tparam: Yes. Inlineable: No. Recursive: Yes.
-#define BOOST_LOCAL_FUNCTION_AUX_NAME_RECURSIVE_(local_function_name) \
- BOOST_LOCAL_FUNCTION_AUX_NAME_END_LOCAL_FUNCTOR_(__LINE__, \
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_RECURSIVE_( \
+ typename01, local_function_name) \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_END_LOCAL_FUNCTOR_(typename01, \
             local_function_name, \
             /* recursive local function -- but it cannot be inlined */ \
             1 /* recursive */ , \
@@ -135,9 +138,10 @@
 // They have more chances to be inlined for faster run-times by some compilers
 // (for example by GCC but not by MSVC). C++11 compilers can always inline
 // local functions even if they are not explicitly specified inline.
-#define BOOST_LOCAL_FUNCTION_AUX_NAME_PARSE_INLINE_(qualified_name) \
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_PARSE_INLINE_( \
+ typename01, qualified_name) \
     BOOST_PP_IIF(BOOST_PP_BITOR( \
- BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01, \
+ BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS, \
             BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_INLINE_FRONT( \
                     qualified_name)), \
         /* on C++11 always use inlining because compilers might optimize */ \
@@ -148,7 +152,7 @@
         /* programmers `inline name` the inlined local function cannot be */ \
         /* passed as tparam */ \
         BOOST_LOCAL_FUNCTION_AUX_NAME_ \
- )(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT( \
+ )(typename01, BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT( \
             qualified_name))
 
 // Expand to 1 iff `recursive name` or `recursive inline name` or
@@ -178,18 +182,20 @@
 
 // Recursive local function are specified by `..._NAME(recursive name)`.
 // They can never be inlined for faster run-time (not even by C++11 compilers).
-#define BOOST_LOCAL_FUNCTION_AUX_NAME_PARSE_RECURSIVE_(qualified_name) \
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_PARSE_RECURSIVE_( \
+ typename01, qualified_name) \
     BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_AUX_NAME_IS_RECURSIVE_(qualified_name), \
         /* recursion can never be inlined (not even on C++11) */ \
         BOOST_LOCAL_FUNCTION_AUX_NAME_RECURSIVE_ \
     , \
         BOOST_LOCAL_FUNCTION_AUX_NAME_PARSE_INLINE_ \
- )(BOOST_LOCAL_FUNCTION_AUX_NAME_RECURSIVE_REMOVE_(qualified_name))
+ )(typename01, \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_RECURSIVE_REMOVE_(qualified_name))
 
 // PUBLIC //
 
-#define BOOST_LOCAL_FUNCTION_AUX_NAME(qualified_name) \
- BOOST_LOCAL_FUNCTION_AUX_NAME_PARSE_RECURSIVE_(qualified_name)
+#define BOOST_LOCAL_FUNCTION_AUX_NAME(typename01, qualified_name) \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_PARSE_RECURSIVE_(typename01, qualified_name)
 
 #endif // #include guard
 

Modified: branches/release/boost/local_function/aux_/member.hpp
==============================================================================
--- /trunk/boost/local_function/aux_/member.hpp (original)
+++ branches/release/boost/local_function/aux_/member.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -16,24 +16,34 @@
     typedef T& reference;
     typedef T* pointer;
 };
+
 template<typename T> struct member_type<T*> {
     typedef T*& reference;
     typedef T* pointer;
 };
+
+template<typename T> struct member_type<T* const> {
+ typedef T* const& reference;
+ typedef T* pointer;
+};
+
 template<typename T> struct member_type<T const*> {
     typedef T const*& reference;
     typedef T const* pointer;
 };
 
+template<typename T> struct member_type<T const* const> {
+ typedef T const* const& reference;
+ typedef T const* pointer;
+};
+
+// NOTE: Do not add specializations for T const[&/*] (ambiguous on VACPP).
 template<typename T> T* member_addr(T& data) { return &data; }
-template<typename T> T const* member_addr(T const& data) { return &data; }
 template<typename T> T* member_addr(T* data) { return data; }
-template<typename T> T const* member_addr(T const* data) { return data; }
 
+// NOTE: Do not add specializations for T const[&/*] (ambiguous on VACPP).
 template<typename T> T& member_deref(T& data) { return data; }
-template<typename T> T const& member_deref(T const& data) { return data; }
 template<typename T> T& member_deref(T* data) { return *data; }
-template<typename T> T const& member_deref(T const* data) { return *data; }
 
 } } } // namespace
 

Modified: branches/release/boost/local_function/aux_/nobind.hpp
==============================================================================
--- /trunk/boost/local_function/aux_/nobind.hpp (original)
+++ branches/release/boost/local_function/aux_/nobind.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -8,17 +8,21 @@
 #ifndef BOOST_LOCAL_FUNCTION_AUX_NOBIND_HPP_
 #define BOOST_LOCAL_FUNCTION_AUX_NOBIND_HPP_
 
-#include <boost/local_function/aux_/config.hpp>
+#include <boost/local_function/config.hpp>
 
 // NOTE: The current implementation needs no-bind placeholders only when
 // local types cannot be passed as template parameters.
-#if !BOOST_LOCAL_FUNCTION_AUX_CONFIG_LOCALS_AS_TPARAMS_01
+#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
 
 namespace boost { namespace local_function { namespace aux {
 
 typedef int nobind_t; // Tag no-bind type.
 
-nobind_t nobind; // Global variable so all no-binds can reference it.
+static nobind_t nobind; // Global variable so all no-binds can reference it.
+
+// NOTE: Used only to get rid of unused static variable `nobind` (this function
+// is never actually called so it does not need to be defined).
+void no_unused_nobind_warning_(nobind_t* ptr = &nobind);
 
 } } } // namespace
 

Modified: branches/release/boost/local_function/config.hpp
==============================================================================
--- /trunk/boost/local_function/config.hpp (original)
+++ branches/release/boost/local_function/config.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -10,12 +10,25 @@
 
 #ifndef DOXYGEN
 
+#include <boost/config.hpp>
+
 #ifndef BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX
-#define BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX 5
+# define BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX 5
 #endif
 
 #ifndef BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX
-#define BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX 10
+# define BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX 10
+#endif
+
+#ifndef BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
+# ifdef BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS
+# define BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS 0
+# else
+# define BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS 1
+# endif
+#elif BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS // If true, force it to 1.
+# undef BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
+# define BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS 1
 #endif
 
 #else // DOXYGEN
@@ -36,8 +49,9 @@
 excluding bound variables (which are instead specified by
 @RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX}).
 
-_at_See @RefSect{Tutorial} section, @RefSectId{Getting_Started, Getting Started}
-section, @RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX}.
+@See @RefSect{tutorial, Tutorial} section,
+@RefSect{getting_started, Getting Started} section,
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX}.
 */
 #define BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX
 
@@ -52,11 +66,48 @@
 local function parameters (which are instead specified by
 @RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX}).
 
-_at_See @RefSect{Tutorial} section, @RefSectId{Getting_Started, Getting Started}
-section, @RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX}.
+@See @RefSect{tutorial, Tutorial} section,
+@RefSect{getting_started, Getting Started} section,
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX}.
 */
 #define BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX
 
+/**
+@brief Specify when local functions can be passed as template parameters
+without introducing any run-time overhead.
+
+If this macro is defined to <c>1</c>, this library will assume that the
+compiler allows to pass local classes as template parameters:
+@code
+ template<typename T> void f(void) {}
+
+ int main(void) {
+ struct local_class {};
+ f<local_class>();
+ return 0;
+ }
+@endcode
+This is the case for C++11 compilers and some C++03 compilers (e.g., MSVC), but
+it is not the case in general for most C++03 compilers (including GCC).
+This will allow the library to pass local functions as template parameters
+without introducing any run-time overhead (specifically without preventing the
+compiler from optimizing local function calls by inlining their assembly code).
+
+If this macro is defined to <c>0</c> instead, this library will introduce
+a run-time overhead associated to resolving a function pointer call in order to
+still allow to pass the local functions as template parameters.
+
+It is recommended to leave this macro undefined.
+In this case, the library will automatically define this macro to <c>0</c> if
+the Boost.Config macro <c>BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS</c> is
+defined for the specific compiler, and to <c>1</c> otherwise.
+
+@See @RefSect{getting_started, Getting Started} section,
+@RefSect{advanced_topics, Advanced Topics} section,
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME}.
+*/
+#define BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
+
 #endif // DOXYGEN
 
 #endif // #include guard

Modified: branches/release/boost/local_function/detail/preprocessor/keyword/facility/add.hpp
==============================================================================
--- /trunk/boost/local_function/detail/preprocessor/keyword/facility/add.hpp (original)
+++ branches/release/boost/local_function/detail/preprocessor/keyword/facility/add.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -12,12 +12,12 @@
 #include <boost/preprocessor/logical/compl.hpp>
 
 // `is_front_macro(tokens)` is 1 if `tokens` start w/ `keyword` to add, else 0.
-#define BOOST_CLOURE_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT( \
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT( \
         tokens, is_front_macro, keyword) \
     BOOST_PP_EXPR_IIF(BOOST_PP_COMPL(is_front_macro(tokens)), keyword) tokens
 
 // `is_back_macro(tokens)` is 1 if `tokens` end with `keyword` to add, else 0.
-#define BOOST_CLOURE_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK( \
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK( \
         tokens, is_back_macro, keyword) \
     tokens BOOST_PP_EXPR_IIF(BOOST_PP_COMPL(is_back_macro(tokens)), keyword)
 

Modified: branches/release/boost/local_function/detail/preprocessor/void_list.hpp
==============================================================================
--- /trunk/boost/local_function/detail/preprocessor/void_list.hpp (original)
+++ branches/release/boost/local_function/detail/preprocessor/void_list.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -44,7 +44,7 @@
 #ifdef BOOST_NO_VARIADIC_MACROS
 
 #define BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_(is_void_macro, seq) \
- BOOST_LOCAL_FUNCTION_DETAIL_PP_VOId_LIST_HANDLE_SEQ_(is_void_macro, seq)
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_HANDLE_SEQ_(is_void_macro, seq)
 
 #else // VARIADICS
 

Modified: branches/release/boost/scope_exit.hpp
==============================================================================
--- branches/release/boost/scope_exit.hpp (original)
+++ branches/release/boost/scope_exit.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1,73 +1,104 @@
-// Copyright Alexander Nasonov 2006-2009
-//
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
+
+// Copyright (C) 2006-2009, 2012 Alexander Nasonov
+// Copyright (C) 2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
 // http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/scope_exit
 
 #ifndef FILE_boost_scope_exit_hpp_INCLUDED
 #define FILE_boost_scope_exit_hpp_INCLUDED
 
-#include <boost/config.hpp>
+#ifndef DOXYGEN
 
+#include <boost/local_function/detail/preprocessor/line_counter.hpp>
+#include <boost/local_function/detail/preprocessor/void_list.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/thisunderscore.hpp>
 #include <boost/detail/workaround.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/function.hpp>
+#include <boost/typeof/typeof.hpp>
+#include <boost/config.hpp>
 #include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/control/expr_iif.hpp>
+#include <boost/preprocessor/logical/bitor.hpp>
+#include <boost/preprocessor/logical/bitand.hpp>
 #include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/facilities/identity.hpp>
 #include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/punctuation/paren_if.hpp>
 #include <boost/preprocessor/seq/cat.hpp>
-#include <boost/preprocessor/seq/for_each_i.hpp>
 #include <boost/preprocessor/tuple/elem.hpp>
-#include <boost/typeof/typeof.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/list/append.hpp>
+#include <boost/preprocessor/list/fold_left.hpp>
+#include <boost/preprocessor/list/enum.hpp>
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/list/for_each_i.hpp>
+
+// PRIVATE/PROTECTED //
+
+// NOTE: AUX prefix and aux namespace mark "private" symbols that shall be used
+// only within this library; DETAIL prefix and detail namespace mark "protected"
+// symbols that can be used by other Boost libraries but not outside Boost.
 
+// WARNING: BOOST_SCOPE_EXIT_AUX_GCC also used by some regression test.
 #if defined(__GNUC__) && !defined(BOOST_INTEL)
-# define BOOST_SCOPE_EXIT_AUX_GCC (__GNUC__ * 100 + __GNUC_MINOR__)
+# define BOOST_SCOPE_EXIT_AUX_GCC (__GNUC__ * 100 + __GNUC_MINOR__)
 #else
-# define BOOST_SCOPE_EXIT_AUX_GCC 0
+# define BOOST_SCOPE_EXIT_AUX_GCC 0
 #endif
 
 #if BOOST_WORKAROUND(BOOST_SCOPE_EXIT_AUX_GCC, BOOST_TESTED_AT(413))
-#define BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND
+# define BOOST_SCOPE_EXIT_AUX_TPL_GCC_WORKAROUND_01 1
+#else
+# define BOOST_SCOPE_EXIT_AUX_TPL_GCC_WORKAROUND_01 0
+#endif
+
+#if BOOST_MSVC
+# define BOOST_SCOPE_EXIT_AUX_TYPEOF_THIS_MSVC_WORKAROUND_01 1
+#else
+# define BOOST_SCOPE_EXIT_AUX_TYPEOF_THIS_MSVC_WORKAROUND_01 0
 #endif
 
 // Steven Watanabe's trick with a modification suggested by Kim Barrett
-namespace boost { namespace scope_exit { namespace aux {
+namespace boost { namespace scope_exit { namespace detail {
 
- // Type of a local boost_scope_exit_args variable.
- // First use in a local scope will declare the boost_scope_exit_args
- // variable, subsequent uses will be resolved as two comparisons
- // (cmp1 with 0 and cmp2 with boost_scope_exit_args).
- template<int Dummy = 0>
- struct declared
- {
- void* value;
- static int const cmp2 = 0;
- friend void operator>(int, declared const&) {}
- };
+// Type of a local BOOST_SCOPE_EXIT_AUX_ARGS variable.
+// First use in a local scope will declare the BOOST_SCOPE_EXIT_AUX_ARGS
+// variable, subsequent uses will be resolved as two comparisons
+// (cmp1 with 0 and cmp2 with BOOST_SCOPE_EXIT_AUX_ARGS).
+template<int Dummy = 0>
+struct declared
+{
+ void* value;
+ static int const cmp2 = 0;
+ friend void operator>(int, declared const&) {}
+};
 
- struct undeclared { declared<> dummy[2]; };
+struct undeclared { declared<> dummy[2]; };
 
- template<int> struct resolve;
+template<int> struct resolve;
 
- template<>
- struct resolve<sizeof(declared<>)>
- {
- static const int cmp1 = 0;
- };
+template<>
+struct resolve<sizeof(declared<>)>
+{
+ static const int cmp1 = 0;
+};
 
- template<>
- struct resolve<sizeof(undeclared)>
+template<>
+struct resolve<sizeof(undeclared)>
+{
+ template<int>
+ struct cmp1
     {
- template<int>
- struct cmp1
- {
- static int const cmp2 = 0;
- };
+ static int const cmp2 = 0;
     };
-} } }
-
-extern boost::scope_exit::aux::undeclared boost_scope_exit_args; // undefined
-
-
-namespace boost { namespace scope_exit { namespace aux {
+};
 
 typedef void (*ref_tag)(int&);
 typedef void (*val_tag)(int );
@@ -78,7 +109,7 @@
 struct member<T,ref_tag>
 {
     T& value;
-#ifndef BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND
+#if !BOOST_SCOPE_EXIT_AUX_TPL_GCC_WORKAROUND_01
     member(T& ref) : value(ref) {}
 #endif
 };
@@ -87,7 +118,7 @@
 struct member<T,val_tag>
 {
     T value;
-#ifndef BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND
+#if !BOOST_SCOPE_EXIT_AUX_TPL_GCC_WORKAROUND_01
     member(T& val) : value(val) {}
 #endif
 };
@@ -103,165 +134,1183 @@
 
 template<class T> wrapper<T> wrap(T&);
 
-} } }
+} } } // namespace
 
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::scope_exit::aux::wrapper, 1)
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::scope_exit::detail::wrapper, 1)
+
+#define BOOST_SCOPE_EXIT_AUX_ARGS boost_scope_exit_aux_args
+extern boost::scope_exit::detail::undeclared BOOST_SCOPE_EXIT_AUX_ARGS;
+
+#define BOOST_SCOPE_EXIT_AUX_GUARD(id) \
+ BOOST_PP_CAT(boost_se_guard_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_GUARD_T(id) \
+ BOOST_PP_CAT(boost_se_guard_t_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_PARAMS(id) \
+ BOOST_PP_CAT(boost_se_params_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_THIS_T(id) \
+ BOOST_PP_CAT(boost_se_this_t_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_THIS_CAPTURE_T(id) \
+ BOOST_PP_CAT(boost_se_this_capture_t_, id)
 
-#define BOOST_SCOPE_EXIT_AUX_GUARD(id) BOOST_PP_CAT(boost_se_guard_, id)
-#define BOOST_SCOPE_EXIT_AUX_GUARD_T(id) BOOST_PP_CAT(boost_se_guard_t_, id)
-#define BOOST_SCOPE_EXIT_AUX_PARAMS(id) BOOST_PP_CAT(boost_se_params_, id)
-#define BOOST_SCOPE_EXIT_AUX_PARAMS_T(id) BOOST_PP_CAT(boost_se_params_t_, id)
+#define BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id) \
+ BOOST_PP_CAT(boost_se_params_t_, id)
 
-#define BOOST_SCOPE_EXIT_AUX_TAG(id, i) \
+#define BOOST_SCOPE_EXIT_DETAIL_TAG(id, i) \
     BOOST_PP_SEQ_CAT( (boost_se_tag_)(i)(_)(id) )
 
-#define BOOST_SCOPE_EXIT_AUX_PARAM(id, i, var) \
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM_THIS(id) \
+ BOOST_PP_SEQ_CAT( (boost_se_param_this_)(id) )
+
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM(id, i, var) \
     BOOST_PP_SEQ_CAT( (boost_se_param_)(i)(_)(id) )
 
-#define BOOST_SCOPE_EXIT_AUX_PARAM_T(id, i, var) \
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM_T(id, i, var) \
     BOOST_PP_SEQ_CAT( (boost_se_param_t_)(i)(_)(id) )
 
-#define BOOST_SCOPE_EXIT_AUX_CAPTURE_T(id, i, var) \
+#define BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(id, i, var) \
     BOOST_PP_SEQ_CAT( (boost_se_capture_t_)(i)(_)(id) )
 
 #define BOOST_SCOPE_EXIT_AUX_WRAPPED(id, i) \
     BOOST_PP_SEQ_CAT( (boost_se_wrapped_t_)(i)(_)(id) )
 
 #define BOOST_SCOPE_EXIT_AUX_DEREF(id, i, var) \
- boost::scope_exit::aux::deref(var, (BOOST_SCOPE_EXIT_AUX_TAG(id,i))0)
+ ::boost::scope_exit::detail::deref(var, \
+ static_cast<BOOST_SCOPE_EXIT_DETAIL_TAG(id, i)>(0))
 
 #define BOOST_SCOPE_EXIT_AUX_MEMBER(r, id, i, var) \
- boost::scope_exit::aux::member< \
- BOOST_SCOPE_EXIT_AUX_PARAM_T(id,i,var), \
- BOOST_SCOPE_EXIT_AUX_TAG(id,i) \
- > BOOST_SCOPE_EXIT_AUX_PARAM(id,i,var);
-
-// idty is (id,typename) or (id,BOOST_PP_EMPTY())
-#define BOOST_SCOPE_EXIT_AUX_ARG_DECL(r, idty, i, var) \
- BOOST_PP_COMMA_IF(i) BOOST_PP_TUPLE_ELEM(2,1,idty) \
- BOOST_SCOPE_EXIT_AUX_PARAMS_T(BOOST_PP_TUPLE_ELEM(2,0,idty)):: \
- BOOST_SCOPE_EXIT_AUX_PARAM_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var) var
+ ::boost::scope_exit::detail::member< \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(id, i, var), \
+ BOOST_SCOPE_EXIT_DETAIL_TAG(id, i) \
+ > BOOST_SCOPE_EXIT_DETAIL_PARAM(id, i, var);
+
+#define BOOST_SCOPE_EXIT_AUX_ARG_DECL(r, id_ty, i, var) \
+ BOOST_PP_COMMA_IF(i) \
+ BOOST_PP_TUPLE_ELEM(2, 1, id_ty) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(BOOST_PP_TUPLE_ELEM(2, 0, id_ty)):: \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var) \
+ var
  
-#define BOOST_SCOPE_EXIT_AUX_ARG(r, id, i, var) BOOST_PP_COMMA_IF(i) \
- boost_se_params_->BOOST_SCOPE_EXIT_AUX_PARAM(id,i,var).value
+#define BOOST_SCOPE_EXIT_AUX_ARG(r, id, i, var) \
+ BOOST_PP_COMMA_IF(i) \
+ boost_se_params_->BOOST_SCOPE_EXIT_DETAIL_PARAM(id, i, var).value
+
+#define BOOST_SCOPE_EXIT_DETAIL_TAG_DECL(r, id, i, var) \
+ typedef void (*BOOST_SCOPE_EXIT_DETAIL_TAG(id, i))(int var);
+
+// Adam Butcher's workaround to deduce `this` type on MSVC revision < 10.
+// Boost.Typeof for VC71's typeid-based workaround does not work to determine
+// `this` type due to error C2355 being incorrectly reported. The typical
+// avoidance strategy implemented below is to make an indirect compile-time
+// constant by assigning an enum and use that as type-index-- this only works
+// with the sizeof() approach and not with the typeid() approach. Lorenzo
+// Caminiti extended this approach to work in type-of emulation mode. This code
+// is very similar (and somewhat of a duplication) of the code in
+// boost/typeof/msvc/typeof_impl.hpp). However, this code cannot be integrated
+// into Boost.Typeof because its final API has to be a `typedef ...` and it
+// cannot be a `typeof(...)`.
+#if BOOST_SCOPE_EXIT_AUX_TYPEOF_THIS_MSVC_WORKAROUND_01
 
-#define BOOST_SCOPE_EXIT_AUX_TAG_DECL(r, id, i, var) \
- typedef void (*BOOST_SCOPE_EXIT_AUX_TAG(id,i))(int var);
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/type_traits/is_function.hpp>
+#include <boost/utility/enable_if.hpp>
 
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1310)
+# include <typeinfo>
+#endif
 
-#ifdef BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND
+namespace boost { namespace scope_exit { namespace aux {
+ namespace msvc_typeof_this {
 
-#define BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, seq)
+// compile-time constant code
+#if BOOST_WORKAROUND(BOOST_MSVC, >=1300) && defined(_MSC_EXTENSIONS)
 
-#define BOOST_SCOPE_EXIT_AUX_PARAM_INIT(r, id, i, var) \
- BOOST_PP_COMMA_IF(i) { BOOST_SCOPE_EXIT_AUX_DEREF(id,i,var) }
+template<int N> struct the_counter;
 
-#define BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id, seq) \
- = { BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_PARAM_INIT, id, seq) };
+template<typename T,int N = 5 /* for similarity */>
+struct encode_counter {
+ __if_exists(the_counter<N + 256>) {
+ BOOST_STATIC_CONSTANT(unsigned,
+ count=(encode_counter<T,N + 257>::count));
+ }
+ __if_not_exists(the_counter<N + 256>) {
+ __if_exists(the_counter<N + 64>) {
+ BOOST_STATIC_CONSTANT(unsigned,
+ count=(encode_counter<T,N + 65>::count));
+ }
+ __if_not_exists(the_counter<N + 64>) {
+ __if_exists(the_counter<N + 16>) {
+ BOOST_STATIC_CONSTANT(unsigned,
+ count=(encode_counter<T,N + 17>::count));
+ }
+ __if_not_exists(the_counter<N + 16>) {
+ __if_exists(the_counter<N + 4>) {
+ BOOST_STATIC_CONSTANT(unsigned,
+ count=(encode_counter<T,N + 5>::count));
+ }
+ __if_not_exists(the_counter<N + 4>) {
+ __if_exists(the_counter<N>) {
+ BOOST_STATIC_CONSTANT(unsigned,
+ count=(encode_counter<T,N + 1>::count));
+ }
+ __if_not_exists(the_counter<N>) {
+ BOOST_STATIC_CONSTANT(unsigned,count=N);
+ typedef the_counter<N> type;
+ }
+ }
+ }
+ }
+ }
+};
 
-#else
+#else // compile-time constant code
+
+template<int N> struct encode_counter : encode_counter<N - 1> {};
+
+template<> struct encode_counter<0> {};
+
+#endif // compile-time constant code
+
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1300) // type-of code
+
+template<typename ID>
+struct msvc_extract_type
+{
+ template<bool>
+ struct id2type_impl;
+
+ typedef id2type_impl<true> id2type;
+};
+
+template<typename T, typename ID>
+struct msvc_register_type : msvc_extract_type<ID>
+{
+ template<>
+ struct id2type_impl<true> { // VC7.0 specific bug-feature.
+ typedef T type;
+ };
+};
+
+#elif BOOST_WORKAROUND(BOOST_MSVC, >= 1400) // type-of code
+
+struct msvc_extract_type_default_param {};
+
+template<typename ID, typename T = msvc_extract_type_default_param>
+struct msvc_extract_type;
+
+template<typename ID>
+struct msvc_extract_type<ID, msvc_extract_type_default_param> {
+ template<bool>
+ struct id2type_impl;
+
+ typedef id2type_impl<true> id2type;
+};
+
+template<typename ID, typename T>
+struct msvc_extract_type
+ : msvc_extract_type<ID, msvc_extract_type_default_param> {
+ template<>
+ struct id2type_impl<true> { // VC8.0 specific bug-feature.
+ typedef T type;
+ };
+
+ template<bool>
+ struct id2type_impl;
+
+ typedef id2type_impl<true> id2type;
+};
+
+template<typename T, typename ID>
+struct msvc_register_type : msvc_extract_type<ID, T> {};
+
+#else // type-of code
+
+template<typename ID>
+struct msvc_extract_type {
+ struct id2type;
+};
+
+template<typename T, typename ID>
+struct msvc_register_type : msvc_extract_type<ID> {
+ typedef msvc_extract_type<ID> base_type;
+ struct base_type::id2type { // This uses nice VC6.5 and VC7.1 bug-features.
+ typedef T type;
+ };
+};
+
+#endif // typeof code
+
+template<int Id>
+struct msvc_typeid_wrapper {
+ typedef typename msvc_extract_type<boost::mpl::int_<Id>
+ >::id2type id2type;
+ typedef typename id2type::type type;
+};
+
+template<>
+struct msvc_typeid_wrapper<4> {
+ typedef msvc_typeid_wrapper<4> type;
+};
 
-#define BOOST_SCOPE_EXIT_AUX_CTOR_ARG(r, id, i, var) BOOST_PP_COMMA_IF(i) \
- BOOST_SCOPE_EXIT_AUX_PARAM_T(id,i,var) & BOOST_PP_CAT(a,i)
+template<typename T>
+struct encode_type {
+ BOOST_STATIC_CONSTANT(unsigned, value = encode_counter<T>::count);
+ typedef typename msvc_register_type<T,
+ boost::mpl::int_<value> >::id2type type;
+ BOOST_STATIC_CONSTANT(unsigned, next = value + 1);
+};
 
-#define BOOST_SCOPE_EXIT_AUX_MEMBER_INIT(r, id, i, var) BOOST_PP_COMMA_IF(i) \
- BOOST_SCOPE_EXIT_AUX_PARAM(id,i,var) ( BOOST_PP_CAT(a,i) )
+template<class T>
+struct sizer {
+ typedef char(*type)[encode_type<T>::value];
+};
 
-#define BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, seq) \
- BOOST_SCOPE_EXIT_AUX_PARAMS_T(id)( \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_CTOR_ARG, id, seq ) ) \
- : BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_MEMBER_INIT, id, seq) {}
+template<typename T>
+typename boost::disable_if<
+ typename boost::is_function<T>::type
+ , typename sizer<T>::type
+>::type encode_start(T const&);
+
+template<typename T>
+typename boost::enable_if<
+ typename boost::is_function<T>::type
+ , typename sizer<T>::type
+>::type encode_start(T&);
+
+template<typename Organizer, typename T>
+msvc_register_type<T, Organizer> typeof_register_type(const T&,
+ Organizer* = 0);
+
+} } } } // namespace
+
+#define BOOST_SCOPE_EXIT_AUX_TYPEDEF_TYPEOF_THIS_INDEX_(id) \
+ BOOST_PP_CAT(boost_se_thistype_index_, id)
+
+#define BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS(id, ty, new_type) \
+ /* unfortunately, we need to go via this enum which causes this to be */ \
+ /* a typedef construct and not a typeof (so this code cannot be */ \
+ /* integrated into Boost.Typeof) */ \
+ enum { \
+ BOOST_SCOPE_EXIT_AUX_TYPEDEF_TYPEOF_THIS_INDEX_(id) = sizeof( \
+ *::boost::scope_exit::aux::msvc_typeof_this::encode_start(this)) \
+ }; \
+ typedef \
+ ty ::boost::scope_exit::aux::msvc_typeof_this::msvc_typeid_wrapper< \
+ BOOST_SCOPE_EXIT_AUX_TYPEDEF_TYPEOF_THIS_INDEX_(id) \
+ >::type \
+ new_type \
+ ;
+
+#else // TYPEOF_THIS_MSVC_WORKAROUND
+
+#define BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS(id, ty, new_type) \
+ typedef /* trailing `EMPTY()` handles empty `ty` */ \
+ BOOST_PP_IIF(BOOST_PP_IS_EMPTY(ty BOOST_PP_EMPTY()), \
+ BOOST_TYPEOF \
+ , \
+ BOOST_TYPEOF_TPL \
+ )(this) \
+ new_type \
+ ;
+
+#endif // TYPEOF_THIS_MSVC_WORKAROUND
+
+#if BOOST_SCOPE_EXIT_AUX_TPL_GCC_WORKAROUND_01
+
+#define BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, ty, captures, has_this) \
+ /* expand to nothing */
+
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM_INIT(r, id, i, var) \
+ BOOST_PP_COMMA_IF(i) { BOOST_SCOPE_EXIT_AUX_DEREF(id, i, var) }
+
+#define BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id, captures, has_this) \
+ BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(has_this, \
+ BOOST_PP_LIST_IS_CONS(captures)), \
+ = { \
+ ) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_PARAM_INIT, id, captures) \
+ BOOST_PP_COMMA_IF(BOOST_PP_BITAND(BOOST_PP_LIST_IS_CONS(captures), \
+ has_this)) \
+ BOOST_PP_EXPR_IIF(has_this, this) /* no extra {...} needed here */ \
+ BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(has_this, \
+ BOOST_PP_LIST_IS_CONS(captures)), \
+ } /* trailing `;` will be added by the caller */ \
+ )
+
+#else // TPL_GCC_WORKAROUND
+
+#define BOOST_SCOPE_EXIT_AUX_CTOR_ARG(r, id, i, var) \
+ BOOST_PP_COMMA_IF(i) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(id, i, var) & BOOST_PP_CAT(a, i)
+
+#define BOOST_SCOPE_EXIT_AUX_MEMBER_INIT(r, id, i, var) \
+ BOOST_PP_COMMA_IF(i) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM(id, i, var) ( BOOST_PP_CAT(a, i) )
+
+#define BOOST_SCOPE_EXIT_AUX_CTOR_ARG_THIS_NAME(id) \
+ BOOST_PP_CAT(boost_se_this_arg_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_CTOR_ARG_THIS(id, ty, comma01) \
+ BOOST_PP_COMMA_IF(comma01) \
+ ty BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)::BOOST_SCOPE_EXIT_AUX_THIS_T(id) \
+ BOOST_SCOPE_EXIT_AUX_CTOR_ARG_THIS_NAME(id) /* ptr so no & */
+
+#define BOOST_SCOPE_EXIT_AUX_MEMBER_THIS_INIT(id, comma01) \
+ BOOST_PP_COMMA_IF(comma01) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_THIS(id)( \
+ BOOST_SCOPE_EXIT_AUX_CTOR_ARG_THIS_NAME(id))
+
+#define BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, ty, captures, has_this) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)( \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_CTOR_ARG, id, captures) \
+ BOOST_PP_IIF(has_this, \
+ BOOST_SCOPE_EXIT_AUX_CTOR_ARG_THIS \
+ , \
+ BOOST_PP_TUPLE_EAT(3) \
+ )(id, ty, BOOST_PP_LIST_IS_CONS(captures)) \
+ ) \
+ BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(BOOST_PP_LIST_IS_CONS(captures), \
+ has_this), \
+ : \
+ ) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_MEMBER_INIT, id, \
+ captures) \
+ BOOST_PP_IIF(has_this, \
+ BOOST_SCOPE_EXIT_AUX_MEMBER_THIS_INIT \
+ , \
+ BOOST_PP_TUPLE_EAT(2) \
+ )(id, BOOST_PP_LIST_IS_CONS(captures)) \
+ {}
 
-#define BOOST_SCOPE_EXIT_AUX_PARAM_INIT(r, id, i, var) \
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM_INIT(r, id, i, var) \
     BOOST_PP_COMMA_IF(i) BOOST_SCOPE_EXIT_AUX_DEREF(id,i,var)
 
-#define BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id, seq) \
- ( BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_PARAM_INIT, id, seq) );
+#define BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id, captures, has_this) \
+ BOOST_PP_LPAREN_IF(BOOST_PP_BITOR(has_this, \
+ BOOST_PP_LIST_IS_CONS(captures))) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_PARAM_INIT, id, captures) \
+ BOOST_PP_COMMA_IF(BOOST_PP_BITAND(BOOST_PP_LIST_IS_CONS(captures), \
+ has_this)) \
+ BOOST_PP_EXPR_IIF(has_this, this) \
+ BOOST_PP_RPAREN_IF(BOOST_PP_BITOR(has_this, \
+ BOOST_PP_LIST_IS_CONS(captures)))
 
-#endif
+#endif // TPL_GCC_WORKAROUND
 
 #if defined(BOOST_TYPEOF_EMULATION)
 
-#define BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL(r, idty, i, var) \
- struct BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i) \
- : BOOST_TYPEOF(boost::scope_exit::aux::wrap( \
- BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var))) \
- {}; typedef BOOST_PP_TUPLE_ELEM(2,1,idty) \
- BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i)::type \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var);
+#define BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL(r, id_ty, i, var) \
+ struct BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), i) \
+ /* no need to use TYPEOF_TPL here because it's within inheritance */ \
+ : BOOST_TYPEOF(::boost::scope_exit::detail::wrap( \
+ BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var))) \
+ {}; \
+ typedef BOOST_PP_TUPLE_ELEM(2, 1, id_ty) \
+ BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), i)::type\
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var) \
+ ;
 
 #elif defined(BOOST_INTEL)
 
-#define BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL(r, idty, i, var) \
- typedef BOOST_TYPEOF_KEYWORD( \
- BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var)) \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var);
+#define BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL(r, id_ty, i, var) \
+ typedef \
+ /* no TYPEOF_TPL here because uses TYPEOF_KEYWORD directly */ \
+ BOOST_TYPEOF_KEYWORD(BOOST_SCOPE_EXIT_AUX_DEREF( \
+ BOOST_PP_TUPLE_ELEM(2, 0, id_ty), i, var)) \
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var) \
+ ;
 
 #else
 
-#define BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL(r, idty, i, var) \
- typedef BOOST_TYPEOF(boost::scope_exit::aux::wrap( \
- BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var))) \
- BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i); \
- typedef BOOST_PP_TUPLE_ELEM(2,1,idty) \
- BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i)::type \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var);
+#define BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL(r, id_ty, i, var) \
+ typedef \
+ /* no need to use TYPEOF_TPL here because it's a typedef */ \
+ BOOST_TYPEOF(::boost::scope_exit::detail::wrap( \
+ BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var))) \
+ BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), i) \
+ ; \
+ typedef BOOST_PP_TUPLE_ELEM(2, 1, id_ty) \
+ BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), i)::type\
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var) \
+ ;
 
 #endif
 
-#define BOOST_SCOPE_EXIT_AUX_PARAM_DECL(r, idty, i, var) \
- typedef BOOST_SCOPE_EXIT_AUX_CAPTURE_T( \
- BOOST_PP_TUPLE_ELEM(2,0,idty), i, var) \
- BOOST_SCOPE_EXIT_AUX_PARAM_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var);
-
-
-#define BOOST_SCOPE_EXIT_AUX_IMPL(id, seq, ty) \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_TAG_DECL, id, seq) \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL, (id,ty), seq) \
- struct BOOST_SCOPE_EXIT_AUX_PARAMS_T(id) { \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_PARAM_DECL, (id,ty), seq) \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_MEMBER, id, seq) \
- BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, seq) \
- } BOOST_SCOPE_EXIT_AUX_PARAMS(id) BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id,seq) \
- boost::scope_exit::aux::declared< boost::scope_exit::aux::resolve< \
- sizeof(boost_scope_exit_args)>::cmp1<0>::cmp2 > boost_scope_exit_args; \
- boost_scope_exit_args.value = &BOOST_SCOPE_EXIT_AUX_PARAMS(id); \
- struct BOOST_SCOPE_EXIT_AUX_GUARD_T(id) { \
- BOOST_SCOPE_EXIT_AUX_PARAMS_T(id)* boost_se_params_; \
- BOOST_SCOPE_EXIT_AUX_GUARD_T(id) (void* boost_se_params) \
- : boost_se_params_( \
- (BOOST_SCOPE_EXIT_AUX_PARAMS_T(id)*)boost_se_params) \
- {} \
- ~BOOST_SCOPE_EXIT_AUX_GUARD_T(id)() { boost_se_body( \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_ARG, id, seq) ); } \
- static void boost_se_body(BOOST_PP_SEQ_FOR_EACH_I( \
- BOOST_SCOPE_EXIT_AUX_ARG_DECL, (id,ty), seq) )
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM_DECL(r, id_ty, i, var) \
+ typedef \
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var) \
+ ;
+
+// Traits.
+
+#define BOOST_SCOPE_EXIT_AUX_TRAITS_OP_CAPTURE(d, captures, this01, capture) \
+ (BOOST_PP_LIST_APPEND(captures, (capture, BOOST_PP_NIL)), this01)
+
+#define BOOST_SCOPE_EXIT_AUX_TRAITS_OP_THIS(d, captures, this01, this_) \
+ (captures, 1 /* has this (note, no error if multiple this_) */)
+
+#define BOOST_SCOPE_EXIT_AUX_TRAITS_OP(d, captures_this, capture) \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK(\
+ capture), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_OP_THIS \
+ , \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_OP_CAPTURE \
+ )(d, BOOST_PP_TUPLE_ELEM(2, 0, captures_this), \
+ BOOST_PP_TUPLE_ELEM(2, 1, captures_this), capture)
+
+// ref_val: & | =
+#define BOOST_SCOPE_EXIT_AUX_TRAITS_ALL_OP(ref_val, traits) \
+ ( \
+ BOOST_PP_LIST_APPEND((ref_val, BOOST_PP_NIL), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ , \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits) \
+ )
+
+#define BOOST_SCOPE_EXIT_AUX_TRAITS(captures) \
+ BOOST_PP_LIST_FOLD_LEFT(BOOST_SCOPE_EXIT_AUX_TRAITS_OP, \
+ (BOOST_PP_NIL, 0), captures)
+
+#define BOOST_SCOPE_EXIT_AUX_TRAITS_ALL(captures) \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_ALL_OP(BOOST_PP_LIST_FIRST(captures), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS(BOOST_PP_LIST_REST(captures)))
 
-#if defined(BOOST_MSVC)
+#define BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits) \
+ BOOST_PP_TUPLE_ELEM(2, 0, traits)
 
-#define BOOST_SCOPE_EXIT_END } BOOST_SCOPE_EXIT_AUX_GUARD(__COUNTER__) ( \
- boost_scope_exit_args.value);
+#define BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits) \
+ BOOST_PP_TUPLE_ELEM(2, 1, traits)
 
-#define BOOST_SCOPE_EXIT(seq) \
- BOOST_SCOPE_EXIT_AUX_IMPL(__COUNTER__, seq, BOOST_PP_EMPTY())
+#ifndef BOOST_NO_LAMBDAS
 
-#else
+namespace boost { namespace scope_exit { namespace aux {
 
-#define BOOST_SCOPE_EXIT_END } BOOST_SCOPE_EXIT_AUX_GUARD(__LINE__) ( \
- boost_scope_exit_args.value);
+template<typename This = void>
+struct guard { // With object `this_` (for backward compatibility).
+ explicit guard(This _this) : this_(_this) {}
+ ~guard() { if(f_) f_(this_); }
+ template<typename Lambda>
+ void operator=(Lambda f) { f_ = f; }
+private:
+ This this_;
+ boost::function<void (This)> f_;
+};
 
-#define BOOST_SCOPE_EXIT(seq) \
- BOOST_SCOPE_EXIT_AUX_IMPL(__LINE__, seq, BOOST_PP_EMPTY())
+template<>
+struct guard<void> { // Without object `this_` (could capture `this` directly).
+ ~guard() { if(f_) f_(); }
+ template<typename Lambda>
+ void operator=(Lambda f) { f_ = f; }
+private:
+ boost::function<void (void)> f_;
+};
 
-#endif
+} } } // namespace
+
+#define BOOST_SCOPE_EXIT_AUX_LAMBDA_PARAMS(id) \
+ BOOST_PP_CAT(boost_se_lambda_params_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_CAPTURE_TYPE(id) \
+ BOOST_PP_CAT(boost_se_lambda_this_t_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_PARAM_TYPE(id) \
+ BOOST_PP_CAT(boost_se_lambda_this_capture_t_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_TYPE(id, ty) \
+ ty BOOST_SCOPE_EXIT_AUX_LAMBDA_PARAMS(id):: \
+ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_PARAM_TYPE(id)
+
+// Precondition: HAS_THIS(traits).
+#define BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_TYPEDEFS(id, ty, traits) \
+ BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS(id, ty, \
+ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_CAPTURE_TYPE(id)) \
+ /* capture type for workaround GCC internal error (even on later C++11) */ \
+ struct BOOST_SCOPE_EXIT_AUX_LAMBDA_PARAMS(id) { \
+ typedef BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_CAPTURE_TYPE(id) \
+ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_PARAM_TYPE(id); \
+ };
 
-#ifdef BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND
-#define BOOST_SCOPE_EXIT_TPL(seq) \
- BOOST_SCOPE_EXIT_AUX_IMPL(__LINE__, seq, typename)
-#else
-#define BOOST_SCOPE_EXIT_TPL(seq) BOOST_SCOPE_EXIT(seq)
-#endif
+#define BOOST_SCOPE_EXIT_AUX_IMPL_LAMBDA(id, ty, traits) \
+ BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ /* no need for TYPEDEF THIS MSVC workaround on C++11 */ \
+ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_TYPEDEFS \
+ , \
+ BOOST_PP_TUPLE_EAT(3) \
+ )(id, ty, traits) \
+ ::boost::scope_exit::aux::guard< \
+ BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_TYPE \
+ , \
+ BOOST_PP_TUPLE_EAT(2) \
+ )(id, ty) \
+ > BOOST_SCOPE_EXIT_AUX_GUARD(id) \
+ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ (this) \
+ ) \
+ ; \
+ BOOST_SCOPE_EXIT_AUX_GUARD(id) = [ \
+ BOOST_PP_LIST_ENUM(BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ ]( \
+ BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_TYPE \
+ , \
+ BOOST_PP_TUPLE_EAT(2) \
+ )(id, ty) \
+ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), this_) \
+ ) mutable /* can change value captures (as with SCOPE_EXIT) */ -> void
+
+#endif // Lambdas.
+
+#if defined(BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS) && \
+ !defined(BOOST_NO_LAMBDAS) // Use lambda for SCOPE_EXIT (not just _ALL).
+
+#define BOOST_SCOPE_EXIT_AUX_IMPL(id, ty, traits) \
+ BOOST_SCOPE_EXIT_AUX_IMPL_LAMBDA(id, ty, traits)
+
+#else // Not using lambdas.
+
+// ty: EMPTY() | typename
+#define BOOST_SCOPE_EXIT_AUX_IMPL(id, ty, traits) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_TAG_DECL, id, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL, (id, ty), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS \
+ , \
+ BOOST_PP_TUPLE_EAT(3) \
+ )(id, ty, BOOST_SCOPE_EXIT_AUX_THIS_CAPTURE_T(id)) \
+ struct BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id) { \
+ /* interim capture types to workaround internal errors on old GCC */ \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_PARAM_DECL, (id, ty), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ typedef BOOST_SCOPE_EXIT_AUX_THIS_CAPTURE_T(id) \
+ BOOST_SCOPE_EXIT_AUX_THIS_T(id) ; \
+ ) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_MEMBER, id, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ BOOST_SCOPE_EXIT_AUX_THIS_T(id) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_THIS(id) ; \
+ ) \
+ BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, ty, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits)) \
+ } BOOST_SCOPE_EXIT_AUX_PARAMS(id) \
+ BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits)) \
+ ; \
+ ::boost::scope_exit::detail::declared< \
+ ::boost::scope_exit::detail::resolve< \
+ sizeof(BOOST_SCOPE_EXIT_AUX_ARGS) \
+ >::cmp1<0>::cmp2 \
+ > BOOST_SCOPE_EXIT_AUX_ARGS; \
+ BOOST_SCOPE_EXIT_AUX_ARGS.value = &BOOST_SCOPE_EXIT_AUX_PARAMS(id); \
+ struct BOOST_SCOPE_EXIT_AUX_GUARD_T(id) { \
+ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)* boost_se_params_; \
+ BOOST_SCOPE_EXIT_AUX_GUARD_T(id) (void* boost_se_params) \
+ : boost_se_params_( \
+ (BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)*)boost_se_params) \
+ {} \
+ ~BOOST_SCOPE_EXIT_AUX_GUARD_T(id)() { \
+ boost_se_body( \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_ARG, id, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ BOOST_PP_COMMA_IF(BOOST_PP_BITAND(BOOST_PP_LIST_IS_CONS( \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits))) \
+ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS( \
+ traits), \
+ boost_se_params_->BOOST_SCOPE_EXIT_DETAIL_PARAM_THIS(id) \
+ ) \
+ ); \
+ } \
+ static void boost_se_body( \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_ARG_DECL, (id, ty), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ BOOST_PP_COMMA_IF(BOOST_PP_BITAND(BOOST_PP_LIST_IS_CONS( \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits))) \
+ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ ty BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id):: \
+ BOOST_SCOPE_EXIT_AUX_THIS_T(id) this_ \
+ ) \
+ )
+
+#endif // Using lambdas.
+
+// PUBLIC //
+
+#if defined(BOOST_NO_VARIADIC_MACROS) // No variadic macros (sequences only).
+# define BOOST_SCOPE_EXIT_ID(id, void_or_seq) \
+ BOOST_SCOPE_EXIT_AUX_IMPL(id, BOOST_PP_EMPTY(), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(void_or_seq)))
+# define BOOST_SCOPE_EXIT_ID_TPL(id, void_or_seq) \
+ BOOST_SCOPE_EXIT_AUX_IMPL(id, typename, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(void_or_seq)))
+# define BOOST_SCOPE_EXIT(void_or_seq) \
+ BOOST_SCOPE_EXIT_ID(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, \
+ void_or_seq)
+# define BOOST_SCOPE_EXIT_TPL(void_or_seq) \
+ BOOST_SCOPE_EXIT_ID_TPL(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, \
+ void_or_seq)
+# if !defined(BOOST_NO_LAMBDAS)
+# define BOOST_SCOPE_EXIT_ALL_ID(id, seq) \
+ BOOST_SCOPE_EXIT_AUX_IMPL_LAMBDA(id, \
+ /* C++11 allows to use typename outside templates so */ \
+ /* always typename here and no need for ..._ALL_TPL */ \
+ /* (if a C++11 compiler does not implement this use of */ \
+ /* typename, always use `this` instead of `this_`) */ \
+ typename, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_ALL( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_NON_VOID_LIST(seq)))
+# define BOOST_SCOPE_EXIT_ALL(seq) \
+ BOOST_SCOPE_EXIT_ALL_ID( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, seq)
+# endif
+#else // Variadic macros (both sequences and variadic tuples).
+# define BOOST_SCOPE_EXIT_ID(id, ...) \
+ BOOST_SCOPE_EXIT_AUX_IMPL(id, BOOST_PP_EMPTY(), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(__VA_ARGS__)))
+# define BOOST_SCOPE_EXIT_ID_TPL(id, ...) \
+ BOOST_SCOPE_EXIT_AUX_IMPL(id, typename, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(__VA_ARGS__)))
+# define BOOST_SCOPE_EXIT(...) \
+ BOOST_SCOPE_EXIT_ID(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, \
+ __VA_ARGS__)
+# define BOOST_SCOPE_EXIT_TPL(...) \
+ BOOST_SCOPE_EXIT_ID_TPL(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, \
+ __VA_ARGS__)
+# if !defined(BOOST_NO_LAMBDAS)
+# define BOOST_SCOPE_EXIT_ALL_ID(id, ...) \
+ BOOST_SCOPE_EXIT_AUX_IMPL_LAMBDA(id, \
+ /* C++11 allows to use typename outside templates so */ \
+ /* always typename here and no need for ..._ALL_TPL */ \
+ /* (if a C++11 compiler does not implement this use of */ \
+ /* typename, always use `this` instead of `this_`) */ \
+ typename, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_ALL( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_NON_VOID_LIST( \
+ __VA_ARGS__)))
+# define BOOST_SCOPE_EXIT_ALL(...) \
+ BOOST_SCOPE_EXIT_ALL_ID( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, __VA_ARGS__)
+# endif
+#endif // Variadics.
+
+#if defined(BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS) && \
+ !defined(BOOST_NO_LAMBDAS) // Use lambdas for SCOPE_EXIT (not just ALL).
+# define BOOST_SCOPE_EXIT_END_ID(id) \
+ ; /* lambdas ended with just `;` */
+#else // Not using lambdas.
+# define BOOST_SCOPE_EXIT_END_ID(id) \
+ } BOOST_SCOPE_EXIT_AUX_GUARD(id)(BOOST_SCOPE_EXIT_AUX_ARGS.value);
+#endif // Using lambdas.
+#define BOOST_SCOPE_EXIT_END \
+ BOOST_SCOPE_EXIT_END_ID(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER)
+
+// DOCUMENTATION //
+
+#else // DOXYGEN
+
+/** @file
+@brief Scope exits allow to execute arbitrary code when the enclosing scope
+exits.
+*/
+
+/**
+@brief This macro declares a scope exit.
+
+The scope exit declaration schedules the execution of the scope exit body at
+the exit of the enclosing scope:
+
+@code
+ { // Some local scope.
+ ...
+ BOOST_SCOPE_EXIT(capture_list) {
+ ... // Body code.
+ } BOOST_SCOPE_EXIT_END
+ ...
+ }
+@endcode
+
+The enclosing scope must be local.
+If multiple scope exits are declared within the same enclosing scope, the scope
+exit bodies are executed in the reversed order of their declarations.
+Note how the end of the scope exit body must be marked by
+@RefMacro{BOOST_SCOPE_EXIT_END}.
+
+@Params
+@Param{capture_list,
+On compilers that support variadic macros (see also Boost.Config
+<c>BOOST_NO_VARIADIC_MACROS</c>)\, the capture list syntax is defined by the
+following grammar:
+@code
+ capture_list:
+ void | capture_tuple | capture_sequence
+ capture_tuple:
+ capture\, capture\, ...
+ capture_sequence:
+ (capture) (capture) ...
+ capture:
+ [&]variable | this_
+@endcode
+On compilers that do not support variadic macros\, <c>capture_tuple</c> cannot
+be used:
+@code
+ capture_list:
+ void | capture_sequence
+@endcode
+Furthermore\, if @RefMacro{BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS} is defined on
+C++11 compilers that support lambda functions (i.e.\, Boost.Config's <c>BOOST_NO_LAMBDAS</c> is not defined) then a semicolon <c>;</c> can be used instead of
+@RefMacro{BOOST_SCOPE_EXIT_END} and <c>this</c> can be used instead of
+<c>this_</c>:
+@code
+ capture:
+ [&]variable | this_ | this
+@endcode
+
+(Lexical conventions: <c>token1 | token2</c> means either <c>token1</c> or
+<c>token2</c>; <c>[token]</c> means either <c>token</c> or nothing;
+<c>{expression}</c> means the tokens resulting from the expression.)
+}
+@EndParams
+
+Note that on compilers that support variadic macros (most of moder compliers
+and all C++11 compilers), the capture list can be specified as a
+comma-separated list of tokens (this is the preferred syntax).
+However, on all compilers the same macro @RefMacro{BOOST_SCOPE_EXIT} also
+allows to specify the capture list as a Boost.Preprocessor sequence of tokens
+(for supporting compilers without variadic macros and for backward compatibility with older versions of this library).
+
+The name <c>variable</c> of each captured variable must be a valid name in the
+enclosing scope and it must appear exactly once in the capture list.
+If a capture starts with the ampersand sign <c>&</c>, the corresponding
+variable will be available by reference within the scope exit body; otherwise,
+a copy of the variable will be made at the point of the scope exit declaration
+and that copy will be available inside the scope exit body (in this case, the
+variable's type must be <c>CopyConstructible</c>).
+
+From within a member function, the object <c>this</c> can be captured using the
+special name <c>this_</c> in both the capture list and the scope exit body
+(using <c>this</c> instead of <c>this_</c> in the scope exit body leads to
+undefined behaviour).
+
+It is possible to capture no variable by specifying the capture list as
+<c>void</c> (regardless of variadic macro support).
+
+Only variables listed in the capture list, static variables, <c>extern</c>
+variables, global variables, functions, and enumerations from the enclosing
+scope can be used inside the scope exit body.
+
+On various GCC versions the special macro @RefMacro{BOOST_SCOPE_EXIT_TPL} must
+be used instead of @RefMacro{BOOST_SCOPE_EXIT} within templates (to maximize
+portability, it is recommended to always use @RefMacro{BOOST_SCOPE_EXIT_TPL}
+within templates).
+
+On C++11, it is possible capture all variables in scope without listing their
+names one-by-one using the macro @RefMacro{BOOST_SCOPE_EXIT_ALL}.
+
+In general, the special macro @RefMacro{BOOST_SCOPE_EXIT_ID} must be used
+instead of @RefMacro{BOOST_SCOPE_EXIT} when it is necessary to expand multiple
+scope exit declarations on the same line.
+
+@Warning The implementation executes the scope exit body within a destructor
+thus the scope exit body must never throw in order to comply with STL exception
+safety requirements.
+
+@Note The implementation uses Boost.Typeof to automatically deduce the types of
+the captured variables.
+In order to compile code in type-of emulation mode, all types must be properly
+registered with Boost.Typeof (see the
+@RefSect{getting_started, Getting Started} section).
+
+@See @RefSect{tutorial, Tutorial} section,
+@RefSect{getting_started, Getting Started} section,
+@RefSect{no_variadic_macros, No Variadic Macros} section,
+@RefMacro{BOOST_SCOPE_EXIT_TPL}, @RefMacro{BOOST_SCOPE_EXIT_ALL},
+@RefMacro{BOOST_SCOPE_EXIT_END}, @RefMacro{BOOST_SCOPE_EXIT_ID}.
+*/
+#define BOOST_SCOPE_EXIT(capture_list)
+
+/**
+@brief This macro is a workaround for various versions of GCC to declare scope
+exits within templates.
+
+Various versions of the GCC compiler do not compile @RefMacro{BOOST_SCOPE_EXIT}
+inside function templates.
+As a workaround, @RefMacro{BOOST_SCOPE_EXIT_TPL} should be used instead of
+@RefMacro{BOOST_SCOPE_EXIT} in these cases:
+
+@code
+ { // Some local scope.
+ ...
+ BOOST_SCOPE_EXIT_TPL(capture_list) {
+ ... // Body code.
+ } BOOST_SCOPE_EXIT_END
+ ...
+ }
+@endcode
+
+The syntax of @RefMacro{BOOST_SCOPE_EXIT_TPL} is the exact same as the one of
+@RefMacro{BOOST_SCOPE_EXIT} (see @RefMacro{BOOST_SCOPE_EXIT} for more
+information).
+
+On C++11 compilers, @RefMacro{BOOST_SCOPE_EXIT_TPL} is not needed because
+@RefMacro{BOOST_SCOPE_EXIT} always compiles on GCC versions that support C++11.
+However, @RefMacro{BOOST_SCOPE_EXIT_TPL} is still provided on C++11 so to write code that is portable between C++03 and C++11 compilers.
+It is recommended to always use @RefMacro{BOOST_SCOPE_EXIT_TPL} within
+templates so to maximize portability.
+
+In general, the special macro @RefMacro{BOOST_SCOPE_EXIT_ID_TPL} must be used
+instead of @RefMacro{BOOST_SCOPE_EXIT_TPL} when it is necessary to expand
+multiple scope exit declarations on the same line within templates.
+
+@Note The issue in compiling scope exit declarations that some GCC versions
+have is illustrated by the following code (see also
+GCC bug 37920):
+@code
+ template<class T>
+ void f(T const& x) {
+ int i = 0;
+ struct local {
+ typedef __typeof__(i) typeof_i;
+ typedef __typeof__(x) typeof_x;
+ };
+ typedef local::typeof_i i_type;
+ typedef local::typeof_x x_type;
+ }
+
+ int main(void) { f(0); }
+@endcode
+This can be fixed by adding <c>typename</c> in front of <c>local::typeof_i</c>
+and <c>local::typeof_x</c> (which is the approach followed by the
+implementation of the @RefMacro{BOOST_SCOPE_EXIT_TPL} macro).
+
+@Note Although @RefMacro{BOOST_SCOPE_EXIT_TPL} has the same suffix as
+<c>BOOST_TYPEOF_TPL</c>, it does not follow the Boost.Typeof convention.
+
+@See @RefSect{tutorial, Tutorial} section, @RefMacro{BOOST_SCOPE_EXIT},
+@RefMacro{BOOST_SCOPE_EXIT_END}, @RefMacro{BOOST_SCOPE_EXIT_ID_TPL}.
+*/
+#define BOOST_SCOPE_EXIT_TPL(capture_list)
+
+/**
+@brief This macro allows to expand multiple scope exit declarations on the same
+line.
+
+This macro is equivalent to @RefMacro{BOOST_SCOPE_EXIT} but it can be expanded
+multiple times on the same line if different identifiers <c>id</c> are provided
+for each expansion (see @RefMacro{BOOST_SCOPE_EXIT} for more information).
+
+@Params
+@Param{id,
+A unique identifier token which can be concatenated by the preprocessor
+(<c>__LINE__</c>\, <c>scope_exit_number_1_on_line_123</c>\, a combination of
+alphanumeric tokens\, etc).
+}
+@Param{capture_list,
+Same as the <c>capture_list</c> parameter of the @RefMacro{BOOST_SCOPE_EXIT}
+macro.
+}
+@EndParams
+
+@Note This macro can be useful when the scope exit macros are expanded
+within user-defined macros (because nested macros expand on the same line).
+On some compilers (e.g., MSVC which supports the non standard
+<c>__COUNTER__</c> macro) it might not be necessary to use this macro but
+the use of this macro is always necessary to ensure portability when expanding
+multiple scope exit declarations on the same line.
+
+@See @RefSect{tutorial, Tutorial} section, @RefMacro{BOOST_SCOPE_EXIT},
+@RefMacro{BOOST_SCOPE_EXIT_END_ID}, @RefMacro{BOOST_SCOPE_EXIT_ALL_ID},
+@RefMacro{BOOST_SCOPE_EXIT_ID_TPL}.
+*/
+#define BOOST_SCOPE_EXIT_ID(id, capture_list)
+
+/**
+@brief This macro is required to expand multiple scope exit declarations on the
+same line within templates on various versions of GCC.
+
+This macro is equivalent to @RefMacro{BOOST_SCOPE_EXIT_TPL} but it can be
+expanded multiple times on the same line if different identifiers <c>id</c> are
+provided for each expansion (see @RefMacro{BOOST_SCOPE_EXIT_TPL} for more
+information).
+As with @RefMacro{BOOST_SCOPE_EXIT_TPL}, it is recommended to always use this
+macro when expanding scope exits multiple times on the same line within
+templates.
+
+@Params
+@Param{id,
+A unique identifier token which can be concatenated by the preprocessor
+(<c>__LINE__</c>\, <c>scope_exit_number_1_on_line_123</c>\, a combination of
+alphanumeric tokens\, etc).
+}
+@Param{capture_list,
+Same as the <c>capture_list</c> parameter of the
+@RefMacro{BOOST_SCOPE_EXIT_TPL} macro.
+}
+@EndParams
+
+@Note This macro can be useful when the scope exit macros are expanded
+within user-defined macros (because nested macros expand on the same line).
+On some compilers (e.g., MSVC which supports the non standard
+<c>__COUNTER__</c> macro) it might not be necessary to use this macro but
+the use of this macro is always necessary to ensure portability when expanding
+multiple scope exit declarations on the same line.
+
+@See @RefSect{tutorial, Tutorial} section, @RefMacro{BOOST_SCOPE_EXIT_TPL},
+@RefMacro{BOOST_SCOPE_EXIT_END_ID}, @RefMacro{BOOST_SCOPE_EXIT_ID},
+@RefMacro{BOOST_SCOPE_EXIT_ALL_ID}.
+*/
+#define BOOST_SCOPE_EXIT_ID_TPL(id, capture_list)
+
+/**
+@brief This macro declares a scope exit that captures all variables in scope
+(C++11 only).
+
+This macro accepts a capture list starting with either <c>&</c> or <c>=</c> 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 @RefMacro{BOOST_SCOPE_EXIT} (see @RefMacro{BOOST_SCOPE_EXIT} for more information):
+
+@code
+ { // Some local scope.
+ ...
+ BOOST_SCOPE_EXIT_ALL(capture_list) { // C++11 only.
+ ... // Body code.
+ }; // Use `;` instead of `BOOST_SCOPE_EXIT_END` (C++11 only).
+ ...
+ }
+@endcode
+
+Note how the end of the scope exit body declared by this macro must be marked
+by a semi-column <c>;</c> (and not by @RefMacro{BOOST_SCOPE_EXIT_END}).
+
+@Warning This macro is only available on C++11 compilers (specifically, on
+C++11 compilers that do not define the Boost.Config <c>BOOST_NO_LAMBDAS</c>
+macro).
+It is not defined on non-C++11 compilers so its use on non-C++11 compilers will generate a compiler error.
+
+@Params
+@Param{capture_list,
+On compilers that support variadic macros (see also Boost.Config
+<c>BOOST_NO_VARIADIC_MACROS</c>)\, the capture list syntax is defined by the
+following grammar:
+@code
+capture_list:
+ capture_tuple | capture_sequence
+capture_tuple:
+ {& | =} [\, capture\, capture\, ...]
+capture_sequence:
+ {(&) | (=)} [(capture) (capture) ...]
+capture:
+ [&]variable | this_
+@endcode
+On compilers that do not support variadic macros\, <c>capture_tuple</c> cannot
+be used:
+@code
+ capture_list:
+ void | capture_sequence
+@endcode
+Furthermore\, on C++11 compilers that support the use of <c>typename</c>
+outside templates\, also <c>this</c> can be used to capture the object at member
+function scope:
+@code
+ capture:
+ [&]variable | this_ | this
+@endcode
+
+(Lexical conventions: <c>token1 | token2</c> means either <c>token1</c> or
+<c>token2</c>; <c>[token]</c> means either <c>token</c> or nothing;
+<c>{expression}</c> means the token resulting from the expression.)
+}
+@EndParams
+
+Note that on compilers with variadic macro support (which should be all C++11
+compilers), the capture list can be specified as a comma-separated list.
+On all compilers, the same macro @RefMacro{BOOST_SCOPE_EXIT_ALL} also allows to
+specify the capture list as a Boost.Preprocessor sequence.
+
+The capture list must always contain at least the leading <c>&</c> or <c>=</c>
+so it can never be <c>void</c> (<c>BOOST_SCOPE_EXIT(void)</c> should be used
+to program scope exits with an empty capture list).
+
+In general, the special macro @RefMacro{BOOST_SCOPE_EXIT_ALL_ID} must be used
+instead of @RefMacro{BOOST_SCOPE_EXIT_ALL} when it is necessary to expand
+multiple scope exit declarations on the same line.
+
+@Warning This macro capture list follows the exact same syntax of C++11 lambda
+captures which is unfortunately different from the syntax of
+@RefMacro{BOOST_SCOPE_EXIT} captures (unless programmers define the
+@RefMacro{BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS} macro).
+For example, like C++11 lambda functions, @RefMacro{BOOST_SCOPE_EXIT_ALL}
+requires to capture data members by capturing the object <c>this</c> while
+@RefMacro{BOOST_SCOPE_EXIT} allows to capture data members directly and without
+capturing the object.
+
+@Warning The implementation executes the scope exit body within a destructor
+thus the scope exit body must never throw in order to comply with STL exception
+safety requirements.
+
+@Note This macro can always be used also within templates (so there is no need
+for a <c>BOOST_SCOPE_EXIT_ALL_TPL</c> macro).
+
+@See @RefSect{tutorial, Tutorial} section,
+@RefSect{no_variadic_macros, No Variadic Macros} section,
+@RefMacro{BOOST_SCOPE_EXIT}, @RefMacro{BOOST_SCOPE_EXIT_ALL_ID}.
+*/
+#define BOOST_SCOPE_EXIT_ALL(capture_list)
+
+/**
+@brief This macro allows to expand on the same line multiple scope exits that
+capture all variables in scope (C++11 only).
+
+This macro is equivalent to @RefMacro{BOOST_SCOPE_EXIT_ALL} but it can be
+expanded multiple times on the same line if different identifiers <c>id</c> are
+provided for each expansion (see @RefMacro{BOOST_SCOPE_EXIT_ALL} for more
+information).
+As with @RefMacro{BOOST_SCOPE_EXIT_ALL}, this macro is only available on C++11
+compilers (specifically, on C++11 compilers that do not define the
+Boost.Config <c>BOOST_NO_LAMBDAS</c> macro).
+
+@Params
+@Param{id,
+A unique identifier token which can be concatenated by the preprocessor
+(<c>__LINE__</c>\, <c>scope_exit_number_1_on_line_123</c>\, a combination of
+alphanumeric tokens\, etc).
+}
+@Param{capture_list,
+Same as the <c>capture_list</c> parameter of the
+@RefMacro{BOOST_SCOPE_EXIT_ALL} macro.
+}
+@EndParams
+
+@Note This macro can be useful when the scope exit macros are expanded
+within user-defined macros (because nested macros expand on the same line).
+On some compilers (e.g., MSVC which supports the non standard
+<c>__COUNTER__</c> macro) it might not be necessary to use this macro but
+the use of this macro is always necessary to ensure portability when expanding
+multiple scope exit declarations on the same line.
+
+@See @RefSect{tutorial, Tutorial} section, @RefMacro{BOOST_SCOPE_EXIT_ALL},
+@RefMacro{BOOST_SCOPE_EXIT_ID}.
+*/
+#define BOOST_SCOPE_EXIT_ALL_ID(id, capture_list)
+
+/**
+@brief This macro marks the end of a scope exit body.
+
+This macro must follow the closing curly bracket <c>}</c> that ends the body of
+either @RefMacro{BOOST_SCOPE_EXIT} or @RefMacro{BOOST_SCOPE_EXIT_TPL}:
+
+@code
+ { // Some local scope.
+ ...
+ BOOST_SCOPE_EXIT(capture_list) {
+ ... // Body code.
+ } BOOST_SCOPE_EXIT_END
+ ...
+ }
+@endcode
+
+In general, the special macro @RefMacro{BOOST_SCOPE_EXIT_END_ID} must be used
+instead of @RefMacro{BOOST_SCOPE_EXIT_END} when it is necessary to expand
+multiple scope exit bodies on the same line.
+
+@Note If programmers define the @RefMacro{BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS}
+macro on C++11 compilers, a semicolon <c>;</c> can be used instead of this
+macro.
+However, to maximize portability, it is recommended to always use
+@RefMacro{BOOST_SCOPE_EXIT_END}.
+
+@See @RefSect{tutorial, Tutorial} section, @RefMacro{BOOST_SCOPE_EXIT},
+@RefMacro{BOOST_SCOPE_EXIT_TPL}, @RefMacro{BOOST_SCOPE_EXIT_END_ID}.
+*/
+#define BOOST_SCOPE_EXIT_END
+
+/**
+@brief This macro allows to terminate multiple scope exit bodies on the same
+line.
+
+This macro is equivalent to @RefMacro{BOOST_SCOPE_EXIT_END} but it can be
+expanded multiple times on the same line if different identifiers <c>id</c> are
+provided for each expansion (see @RefMacro{BOOST_SCOPE_EXIT_END} for more
+information).
+
+@Params
+@Param{id,
+A unique identifier token which can be concatenated by the preprocessor
+(<c>__LINE__</c>\, <c>scope_exit_number_1_on_line_123</c>\, a combination of
+alphanumeric tokens\, etc).
+}
+@EndParams
+
+@Note This macro can be useful when the scope exit macros are expanded
+within user-defined macros (because macros all expand on the same line).
+On some compilers (e.g., MSVC which supports the non standard
+<c>__COUNTER__</c> macro) it might not be necessary to use this macro but
+the use of this macro is always necessary to ensure portability when expanding
+multiple scope exit macros on the same line (because this library can only
+portably use <c>__LINE__</c> to internally generate unique identifiers).
+
+@See @RefMacro{BOOST_SCOPE_EXIT_ID}, @RefMacro{BOOST_SCOPE_EXIT_ID_TPL},
+@RefMacro{BOOST_SCOPE_EXIT_END}.
+*/
+#define BOOST_SCOPE_EXIT_END_ID(id)
+
+/**
+@brief Force to use C++11 lambda functions to implement scope exits.
+
+If programmers define this configuration macro on a C++11 compiler for which
+the Boost.Config macro <c>BOOST_NO_LAMBDAS</c> is not defined, the
+@RefMacro{BOOST_SCOPE_EXIT} and @RefMacro{BOOST_SCOPE_EXIT_TPL} macros will use
+C++11 lambda functions to declare scope exits.
+By default this macro is not defined.
+
+@Warning When scope exits are implemented using lambda functions, the syntax of
+the capture list follows the exact same syntax of C++11 lambda captures
+which is in general different from the legacy capture syntax of this library.
+For example, C++11 lambdas require to capture data members by capturing the
+object <c>this</c> while this library always allowed to capture data members
+directly.
+Therefore, when this configuration macro is defined,
+@RefMacro{BOOST_SCOPE_EXIT} and @RefMacro{BOOST_SCOPE_EXIT_TPL} are no longer
+backward compatible (and this is why this macro is not defined by default).
+
+A semicolon <c>;</c> can be used instead of @RefMacro{BOOST_SCOPE_EXIT_END}
+when this configuration macro is defined (but it is recommended to always use
+@RefMacro{BOOST_SCOPE_EXIT_END} so to maximize portability).
+
+@Note This configuration macro does not control the definition of
+@RefMacro{BOOST_SCOPE_EXIT_ALL} which is always and automatically defined on
+compilers that support C++11 lambda functions.
+
+@See @RefMacro{BOOST_SCOPE_EXIT}, @RefMacro{BOOST_SCOPE_EXIT_TPL},
+@RefMacro{BOOST_SCOPE_EXIT_END}.
+*/
+#define BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS
+
+#endif // DOXYGEN
 
 #endif // #ifndef FILE_boost_scope_exit_hpp_INCLUDED
 

Copied: branches/release/boost/utility/identity_type.hpp (from r77024, /trunk/boost/utility/identity_type.hpp)
==============================================================================
--- /trunk/boost/utility/identity_type.hpp (original)
+++ branches/release/boost/utility/identity_type.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -28,14 +28,15 @@
 }
 @EndParams
 
-This macro works on any C++03 compiler (it does not require variadic macros).
+This macro works on any C++03 compiler (it does not use variadic macros).
 
 This macro must be prefixed by <c>typename</c> when used within templates.
-However, the compiler will not be able to automatically determine function template parameters when they are wrapped with this macro (these parameters need to
-be explicitly specified when calling the function template).
+Note that the compiler will not be able to automatically determine function
+template parameters when they are wrapped with this macro (these parameters
+need to be explicitly specified when calling the function template).
 
-On some compilers (like GCC), using this macro on an abstract types requires to
-add and remove a reference to the type.
+On some compilers (like GCC), using this macro on abstract types requires to
+add and remove a reference to the specified type.
 */
 #define BOOST_IDENTITY_TYPE(parenthesized_type) \
     /* must NOT prefix this with `::` to work with parenthesized syntax */ \

Modified: branches/release/libs/functional/overloaded_function/doc/Jamfile.v2
==============================================================================
--- /trunk/libs/functional/overloaded_function/doc/Jamfile.v2 (original)
+++ branches/release/libs/functional/overloaded_function/doc/Jamfile.v2 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -17,7 +17,7 @@
         <doxygen:param>WARN_IF_UNDOCUMENTED=NO
         <doxygen:param>HIDE_UNDOC_MEMBERS=YES
         <doxygen:param>HIDE_UNDOC_CLASSES=YES
- <doxygen:param>ALIASES=" Params=\"<b>Parameters:</b> <table border="0">\" Param{2}=\"<tr><td><b><tt>\\1</tt></b></td><td>\\2</td></tr>\" EndParams=\"</table>\" Returns=\"<b>Returns:</b>\" Note=\"<b>Note:</b>\" Warning=\"<b>Warning:</b>\" See=\"<b>See:</b>\" RefSect{1}=\"\\xmlonly<link linkend='boost_functional_overloadedfunction.\\1'>\\1</link>\\endxmlonly\" RefSectId{2}=\"\\xmlonly<link linkend='boost_functional_overloadedfunction.\\1'>\\2</link>\\endxmlonly\" RefClass{1}=\"\\xmlonly<computeroutput><classname alt='\\1'>\\1</classname></computeroutput>\\endxmlonly\" RefFunc{1}=\"\\xmlonly<computeroutput><functionname alt='\\1'>\\1</functionname></computeroutput>\\endxmlonly\" RefMacro{1}=\"\\xmlonly<computeroutput><macroname alt='\\1'>\\1</macroname></computeroutput>\\endxmlonly\" "
+ <doxygen:param>ALIASES=" Params=\"<b>Parameters:</b> <table border="0">\" Param{2}=\"<tr><td><b><tt>\\1</tt></b></td><td>\\2</td></tr>\" EndParams=\"</table>\" Returns=\"<b>Returns:</b>\" Note=\"<b>Note:</b>\" Warning=\"<b>Warning:</b>\" See=\"<b>See:</b>\" RefSect{2}=\"\\xmlonly<link linkend='boost_functional_overloadedfunction.\\1'>\\2</link>\\endxmlonly\" RefClass{1}=\"\\xmlonly<computeroutput><classname alt='\\1'>\\1</classname></computeroutput>\\endxmlonly\" RefFunc{1}=\"\\xmlonly<computeroutput><functionname alt='\\1'>\\1</functionname></computeroutput>\\endxmlonly\" RefMacro{1}=\"\\xmlonly<computeroutput><macroname alt='\\1'>\\1</macroname></computeroutput>\\endxmlonly\" "
     ;
 
 xml qbk : overloaded_function.qbk : <dependency>reference ;

Modified: branches/release/libs/functional/overloaded_function/doc/html/BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX.html
==============================================================================
--- /trunk/libs/functional/overloaded_function/doc/html/BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX.html (original)
+++ branches/release/libs/functional/overloaded_function/doc/html/BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -33,7 +33,7 @@
 
 </span>BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX</pre></div>
 <div class="refsect1">
-<a name="id862354"></a><h2>Description</h2>
+<a name="id813516"></a><h2>Description</h2>
 <p>If this macro is left undefined by the user, it has a default value of 5 (increasing this number might increase compilation time). When specified by the user, this macro must be a non-negative integer number.</p>
 <p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_functional_overloadedfunction/Getting_Started.html" title="Getting Started"> Getting Started</a>, <code class="computeroutput"><a class="link" href="boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code>. </p>
 </div>

Modified: branches/release/libs/functional/overloaded_function/doc/html/BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX.html
==============================================================================
--- /trunk/libs/functional/overloaded_function/doc/html/BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX.html (original)
+++ branches/release/libs/functional/overloaded_function/doc/html/BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -33,7 +33,7 @@
 
 </span>BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX</pre></div>
 <div class="refsect1">
-<a name="id862412"></a><h2>Description</h2>
+<a name="id813573"></a><h2>Description</h2>
 <p>If this macro is left undefined by the user, it has a default value of 5 (increasing this number might increase compilation time). When defined by the user, this macro must be an integer number greater or equal than 2 (because at least two distinct functions need to be specified in order to define an overload).</p>
 <p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_functional_overloadedfunction/Getting_Started.html" title="Getting Started"> Getting Started</a>, <code class="computeroutput"><a class="link" href="boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code>. </p>
 </div>

Modified: branches/release/libs/functional/overloaded_function/doc/html/boost/make_overloaded_function.html
==============================================================================
--- /trunk/libs/functional/overloaded_function/doc/html/boost/make_overloaded_function.html (original)
+++ branches/release/libs/functional/overloaded_function/doc/html/boost/make_overloaded_function.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -36,11 +36,11 @@
   <a class="link" href="overloaded_function.html" title="Class template overloaded_function">overloaded_function</a><span class="special">&lt;</span> <span class="identifier">__function_type__</span><span class="special">&lt;</span> <span class="identifier">F1</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">__function_type__</span><span class="special">&lt;</span> <span class="identifier">F2</span> <span class="special">&gt;</span><span class="special">,</span><span class="special">...</span><span class="special">&gt;</span>
   <span class="identifier">make_overloaded_function</span><span class="special">(</span><span class="identifier">F1</span> f1<span class="special">,</span> <span class="identifier">F2</span> f2<span class="special">,</span> <span class="special">...</span><span class="special">)</span><span class="special">;</span></pre></div>
 <div class="refsect1">
-<a name="id862173"></a><h2>Description</h2>
-<p>This function template creates and returns an <code class="computeroutput"><code class="computeroutput"><a class="link" href="overloaded_function.html" title="Class template overloaded_function">overloaded_function</a></code></code> function object that overloads all the specified functions <code class="computeroutput">f1</code>, <code class="computeroutput">f2</code>, etc.</p>
-<p>The function types are internally determined from the template parameter types so they do not need to be explicitly specified. Therefore, this function template usually has a more concise syntax when compared with <code class="computeroutput"><code class="computeroutput"><a class="link" href="overloaded_function.html" title="Class template overloaded_function">overloaded_function</a></code></code>. This is especially useful when the explicit type of the returned <code class="computeroutput"><code class="computeroutput"><a class="link" href="overloaded_function.html" title="Class template overloaded_function">overloaded_function</a></code></code> does not need to be known (e.g., when used with Boost.Typeof's <code class="computeroutput">BOOST_AUTO</code> (or C++11 <code class="computeroutput">auto</code>) or when the overloaded function object is handled using a function template parameter, see the <a class="link" href="../boost_functional_overloadedfunction/Tutorial.html" title="Tutorial">Tutorial</a>
 section).</p>
+<a name="id813336"></a><h2>Description</h2>
+<p>This function template creates and returns an <code class="computeroutput"><code class="computeroutput"><a class="link" href="overloaded_function.html" title="Class template overloaded_function">overloaded_function</a></code></code> object that overloads all the specified functions <code class="computeroutput">f1</code>, <code class="computeroutput">f2</code>, etc.</p>
+<p>The function types are internally determined from the template parameter types so they do not need to be explicitly specified. Therefore, this function template usually has a more concise syntax when compared with <code class="computeroutput"><code class="computeroutput"><a class="link" href="overloaded_function.html" title="Class template overloaded_function">overloaded_function</a></code></code>. This is especially useful when the explicit type of the returned <code class="computeroutput"><code class="computeroutput"><a class="link" href="overloaded_function.html" title="Class template overloaded_function">overloaded_function</a></code></code> object does not need to be known (e.g., when used with Boost.Typeof's <code class="computeroutput">BOOST_AUTO</code>, C++11 <code class="computeroutput">auto</code>, or when the overloaded function object is handled using a function template parameter, see the <a class="link" href="../boost_functional_overloadedfunction/Tutorial.html" title="Tutorial">Tutorial
</a> section).</p>
 <p>The maximum number of functions to overload is given by the <code class="computeroutput"><code class="computeroutput"><a class="link" href="../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX.html" title="Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX</a></code></code> configuration macro.</p>
-<p><span class="bold"><strong>Note:</strong></span> In this documentation, <code class="computeroutput">__function_type__</code> is a placeholder for a symbol that is specific to implementation of this library.</p>
+<p><span class="bold"><strong>Note:</strong></span> In this documentation, <code class="computeroutput">__function_type__</code> is a placeholder for a symbol that is specific to the implementation of this library.</p>
 <p><span class="bold"><strong>See:</strong></span> <a class="link" href="../boost_functional_overloadedfunction/Tutorial.html" title="Tutorial">Tutorial</a> section, <code class="computeroutput"><code class="computeroutput"><a class="link" href="overloaded_function.html" title="Class template overloaded_function">overloaded_function</a></code></code>, <code class="computeroutput"><code class="computeroutput"><a class="link" href="../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX.html" title="Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX</a></code></code>. </p>
 </div>
 </div>

Modified: branches/release/libs/functional/overloaded_function/doc/html/boost/overloaded_function.html
==============================================================================
--- /trunk/libs/functional/overloaded_function/doc/html/boost/overloaded_function.html (original)
+++ branches/release/libs/functional/overloaded_function/doc/html/boost/overloaded_function.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -35,47 +35,60 @@
 <span class="keyword">class</span> <a class="link" href="overloaded_function.html" title="Class template overloaded_function">overloaded_function</a> <span class="special">{</span>
 <span class="keyword">public</span><span class="special">:</span>
   <span class="comment">// <a class="link" href="overloaded_function.html#boost.overloaded_functionconstruct-copy-destruct">construct/copy/destruct</a></span>
- <a class="link" href="overloaded_function.html#id313802-bb"><span class="identifier">overloaded_function</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span> <span class="identifier">F1</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span>
+ <a class="link" href="overloaded_function.html#id313151-bb"><span class="identifier">overloaded_function</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span> <span class="identifier">F1</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span>
                       <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span> <span class="identifier">F2</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> <span class="special">...</span><span class="special">)</span><span class="special">;</span>
 
- <span class="comment">// <a class="link" href="overloaded_function.html#id313732-bb">public member functions</a></span>
+ <span class="comment">// <a class="link" href="overloaded_function.html#id313082-bb">public member functions</a></span>
   <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F1</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">result_type</span>
- <a class="link" href="overloaded_function.html#id313735-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F1</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
+ <a class="link" href="overloaded_function.html#id313084-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F1</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
              <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F1</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">arg2_type</span><span class="special">,</span> <span class="special">...</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
   <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F2</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">result_type</span>
- <a class="link" href="overloaded_function.html#id313761-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F2</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
+ <a class="link" href="overloaded_function.html#id313110-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F2</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
              <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F2</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">arg2_type</span><span class="special">,</span> <span class="special">...</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
 <span class="special">}</span><span class="special">;</span></pre></div>
 <div class="refsect1">
-<a name="id861426"></a><h2>Description</h2>
-<p>This function object aggregates together calls to functions of all the specified function types <code class="computeroutput">F1</code>, <code class="computeroutput">F2</code>, etc. The specified function types must have distinct parameters from one another and they must be in the following format (which is the Boost.Function preferred syntax): </p>
-<pre class="programlisting"> <span class="identifier">result_type</span> <span class="special">(</span><span class="identifier">argument1_type</span><span class="special">,</span> <span class="identifier">argumgnet2_type</span><span class="special">,</span> <span class="special">...</span><span class="special">)</span>
-</pre>
-<p>In some cases, the <code class="computeroutput"><a class="link" href="make_overloaded_function.html" title="Function template make_overloaded_function">make_overloaded_function</a></code> function template can be useful to construct the overloaded function object without explicitly specifying the function types.</p>
-<p>The maximum number of functions to overload is given by the <code class="computeroutput"><a class="link" href="../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX.html" title="Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX</a></code> configuration macro. The maximum number of function parameters for each of the specified function types is given by the <code class="computeroutput"><a class="link" href="../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX</a></code> configuration macro.</p>
+<a name="id812550"></a><h2>Description</h2>
+<p>This function object aggregates together calls to functions of all the specified function types <code class="computeroutput">F1</code>, <code class="computeroutput">F2</code>, etc which must have distinct function signatures from one another.</p>
+<p><span class="bold"><strong>Parameters:</strong></span> </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody><tr>
+<td><span class="bold"><strong><code class="computeroutput">F<span class="emphasis"><em>i</em></span></code></strong></span></td>
+<td>Each function type must be specified using the following syntax (which is Boost.Function's preferred syntax): <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <span class="identifier">result_type</span> <span class="special">(</span><span class="identifier">argument1_type</span><span class="special">,</span> <span class="identifier">argumgnet2_type</span><span class="special">,</span> <span class="special">...</span><span class="special">)</span>
+</pre> </td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p>In some cases, the <code class="computeroutput"><a class="link" href="make_overloaded_function.html" title="Function template make_overloaded_function">make_overloaded_function</a></code> function template can be useful to construct an overloaded function object without explicitly specifying the function types.</p>
+<p>At least two distinct function types must be specified (because there is nothing to overload between one or zero functions). The maximum number of functions to overload is given by the <code class="computeroutput"><a class="link" href="../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX.html" title="Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX</a></code> configuration macro. The maximum number of function parameters for each of the specified function types is given by the <code class="computeroutput"><a class="link" href="../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX</a></code> configuration macro.</p>
 <p><span class="bold"><strong>See:</strong></span> <a class="link" href="../boost_functional_overloadedfunction/Tutorial.html" title="Tutorial">Tutorial</a> section, <code class="computeroutput"><a class="link" href="make_overloaded_function.html" title="Function template make_overloaded_function">make_overloaded_function</a></code>, <code class="computeroutput"><a class="link" href="../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX.html" title="Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX</a></code>, <code class="computeroutput"><a class="link" href="../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX</a></code>, Boost.Function. </p>
 <div class="refsect2">
-<a name="id861546"></a><h3>
+<a name="id812697"></a><h3>
 <a name="boost.overloaded_functionconstruct-copy-destruct"></a><code class="computeroutput">overloaded_function</code>
         public
        construct/copy/destruct</h3>
 <div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
-<pre class="literallayout"><a name="id313802-bb"></a><span class="identifier">overloaded_function</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span> <span class="identifier">F1</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span>
- <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span> <span class="identifier">F2</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> <span class="special">...</span><span class="special">)</span><span class="special">;</span></pre>Construct the overloaded function object. <p>Any function pointer, function reference, and monomorphic function object that can be converted to a <code class="computeroutput">boost::function</code> function object can be specified as parameter. </p>
+<pre class="literallayout"><a name="id313151-bb"></a><span class="identifier">overloaded_function</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span> <span class="identifier">F1</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span>
+ <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span> <span class="identifier">F2</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> <span class="special">...</span><span class="special">)</span><span class="special">;</span></pre>Construct the overloaded function object. <p>Any function pointer, function reference, and monomorphic function object that can be converted to a <code class="computeroutput">boost::function</code> function object can be specified as parameter.</p>
+<p><span class="bold"><strong>Note:</strong></span> Unfortunately, it is not possible to support polymorphic function objects (as explained here). </p>
 </li></ol></div>
 </div>
 <div class="refsect2">
-<a name="id861671"></a><h3>
-<a name="id313732-bb"></a><code class="computeroutput">overloaded_function</code> public member functions</h3>
+<a name="id812834"></a><h3>
+<a name="id313082-bb"></a><code class="computeroutput">overloaded_function</code> public member functions</h3>
 <div class="orderedlist"><ol class="orderedlist" type="1">
 <li class="listitem">
 <pre class="literallayout"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F1</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">result_type</span>
-<a name="id313735-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F1</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
+<a name="id313084-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F1</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
            <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F1</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">arg2_type</span><span class="special">,</span> <span class="special">...</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Call operator matching the signature of the function type specified as 1st template parameter. <p>This will in turn invoke the call operator of the 1st function passed to the constructor. </p>
 </li>
 <li class="listitem">
 <pre class="literallayout"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F2</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">result_type</span>
-<a name="id313761-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F2</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
+<a name="id313110-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F2</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
            <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special">&lt;</span> <span class="identifier">F2</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">arg2_type</span><span class="special">,</span> <span class="special">...</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Call operator matching the signature of the function type specified as 2nd template parameter. <p>This will in turn invoke the call operator of the 2nd function passed to the constructor.</p>
 <p><span class="bold"><strong>Note:</strong></span> Similar call operators are present for all specified function types <code class="computeroutput">F1</code>, <code class="computeroutput">F2</code>, etc (even if not exhaustively listed by this documentation). </p>
 </li>

Modified: branches/release/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/Getting_Started.html
==============================================================================
--- /trunk/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/Getting_Started.html (original)
+++ branches/release/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/Getting_Started.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -41,9 +41,23 @@
       and Platforms</a>
 </h3></div></div></div>
 <p>
- The library was tested by the authors on GCC 4.5.3 (with and without C++11
- features <code class="literal">-std=c++0x</code>) and MSVC 8.0 under Linux, Cygwin,
- and Windows 7.
+ The authors originally developed and tested this library on:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ GNU Compiler Collection (GCC) C++ 4.5.3 (with and without C++11 features
+ enabled <code class="computeroutput"><span class="special">-</span><span class="identifier">std</span><span class="special">=</span><span class="identifier">c</span><span class="special">++</span><span class="number">0</span><span class="identifier">x</span></code>)
+ on Cygwin.
+ </li>
+<li class="listitem">
+ Miscrosoft Visual C++ (MSVC) 8.0 on Windows 7.
+ </li>
+</ol></div>
+<p>
+ See the library <a href="http://www.boost.org/development/tests/release/developer/functional-overloaded_function.html" target="_top">regressions
+ test results</a> for detailed information on supported compilers and
+ platforms. Check the library regression test Jamfile.v2
+ for any special configuration that might be required for a specific compiler.
       </p>
 </div>
 <div class="section boost_functional_overloadedfunction_Getting_Started_installation">
@@ -59,9 +73,9 @@
 <p>
         The maximum number of functions to overload is given by the <code class="computeroutput"><a class="link" href="../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX.html" title="Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX</a></code>
         configuration macro. The maximum number of function parameters for each of
- the specified function types is given by the <code class="computeroutput"><a class="link" href="../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX</a></code>
+ the specified function type is given by the <code class="computeroutput"><a class="link" href="../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX</a></code>
         configuration macro. All configuration macros have appropriate default values
- when they are left undefined by the user.
+ when they are left undefined.
       </p>
 </div>
 </div>

Modified: branches/release/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/Tutorial.html
==============================================================================
--- /trunk/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/Tutorial.html (original)
+++ branches/release/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/Tutorial.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -39,11 +39,12 @@
 <a name="boost_functional_overloadedfunction.Tutorial.overloading"></a><a class="link" href="Tutorial.html#boost_functional_overloadedfunction.Tutorial.overloading" title="Overloading">Overloading</a>
 </h3></div></div></div>
 <p>
- Consider the following functions with distinct signatures:
+ Consider the following functions which have distinct signatures:
       </p>
 <p>
 </p>
-<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">identity_s</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">x</span><span class="special">;</span> <span class="special">}</span> <span class="comment">// As pointer.</span>
+<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">identity_s</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="comment">// Function (as pointer).</span>
+ <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">x</span><span class="special">;</span> <span class="special">}</span>
 
 <span class="keyword">int</span> <span class="identifier">identity_i_impl</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">x</span><span class="special">;</span> <span class="special">}</span>
 <span class="keyword">int</span> <span class="special">(&amp;</span><span class="identifier">identity_i</span><span class="special">)(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">=</span> <span class="identifier">identity_i_impl</span><span class="special">;</span> <span class="comment">// Function reference.</span>
@@ -58,7 +59,8 @@
         provides a <code class="computeroutput"><a class="link" href="../boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code>
         class template that creates a single overloaded function object that can
         be used to call the specified functions instead of using the separate function
- names (see also identity.cpp):
+ names (see also functor.cpp
+ and identity.hpp):
       </p>
 <p>
 </p>
@@ -69,16 +71,15 @@
 <span class="special">&gt;</span> <span class="identifier">identity</span><span class="special">(</span><span class="identifier">identity_s</span><span class="special">,</span> <span class="identifier">identity_i</span><span class="special">,</span> <span class="identifier">identity_d</span><span class="special">);</span>
 
 <span class="comment">// All calls via single `identity` function.</span>
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="string">"abc"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abc"</span> <span class="special">);</span>
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span> <span class="special">);</span>
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="number">1.23</span><span class="special">)</span> <span class="special">==</span> <span class="number">1.23</span> <span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity</span><span class="special">(</span><span class="string">"abc"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abc"</span><span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span><span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity</span><span class="special">(</span><span class="number">1.23</span><span class="special">)</span> <span class="special">==</span> <span class="number">1.23</span><span class="special">);</span>
 </pre>
 <p>
       </p>
 <p>
- Note how function types in the following format are passed as template parameters
- to <code class="computeroutput"><a class="link" href="../boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code>
- (this is the format of Boost.Function's
+ Note how each function type is passed as a template parameter of <code class="computeroutput"><a class="link" href="../boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code> using
+ the following syntax (this is Boost.Function's
         preferred syntax):
       </p>
 <pre class="programlisting"><span class="emphasis"><em>result-type</em></span> <span class="special">(</span><span class="emphasis"><em>argument1-type</em></span><span class="special">,</span> <span class="emphasis"><em>argument2-type</em></span><span class="special">,</span> <span class="special">...)</span>
@@ -87,10 +88,10 @@
         Then the relative function pointers, function references, or <a href="http://en.wikipedia.org/wiki/Polymorphism_(computer_science)" target="_top">monomorphic
         function</a> objects are passed to the <code class="computeroutput"><a class="link" href="../boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code>
         constructor matching the order of the specified template parameters. <sup>[<a name="boost_functional_overloadedfunction.Tutorial.overloading.f0" href="#ftn.boost_functional_overloadedfunction.Tutorial.overloading.f0" class="footnote">2</a>]</sup> In the above example, <code class="computeroutput"><span class="identifier">identity_s</span></code>
- is passed as function pointer (the function address is automatically taken
- from the function name by compiler), <code class="computeroutput"><span class="identifier">identity_i</span></code>
- as function reference, and <code class="computeroutput"><span class="identifier">identity_d</span></code>
- as function object.
+ is passed as a function pointer (the function address is automatically taken
+ from the function name by the compiler), <code class="computeroutput"><span class="identifier">identity_i</span></code>
+ as a function reference, and <code class="computeroutput"><span class="identifier">identity_d</span></code>
+ as a function object.
       </p>
 <p>
         All specified function types must have distinct parameters from one another
@@ -114,16 +115,17 @@
 <p>
         The <code class="computeroutput"><a class="link" href="../boost/make_overloaded_function.html" title="Function template make_overloaded_function">boost::make_overloaded_function</a></code>
         function template can be useful when used together with Boost.Typeof's
- <code class="computeroutput"><span class="identifier">BOOST_AUTO</span></code> (or C++11 <code class="computeroutput"><span class="keyword">auto</span></code>). For example (see also identity.cpp):
+ <code class="computeroutput"><span class="identifier">BOOST_AUTO</span></code> (or C++11 <code class="computeroutput"><span class="keyword">auto</span></code>). For example (see also make_decl.cpp
+ and identity.hpp):
       </p>
 <p>
 </p>
 <pre class="programlisting"><span class="identifier">BOOST_AUTO</span><span class="special">(</span><span class="identifier">identity</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">make_overloaded_function</span><span class="special">(</span>
         <span class="identifier">identity_s</span><span class="special">,</span> <span class="identifier">identity_i</span><span class="special">,</span> <span class="identifier">identity_d</span><span class="special">));</span>
 
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="string">"abc"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abc"</span> <span class="special">);</span>
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span> <span class="special">);</span>
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="number">1.23</span><span class="special">)</span> <span class="special">==</span> <span class="number">1.23</span> <span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity</span><span class="special">(</span><span class="string">"abc"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abc"</span><span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span><span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity</span><span class="special">(</span><span class="number">1.23</span><span class="special">)</span> <span class="special">==</span> <span class="number">1.23</span><span class="special">);</span>
 </pre>
 <p>
       </p>
@@ -142,16 +144,17 @@
 <p>
         Another case where <code class="computeroutput"><a class="link" href="../boost/make_overloaded_function.html" title="Function template make_overloaded_function">boost::make_overloaded_function</a></code>
         can be useful is when the overloaded function object is passed to a function
- template which can hide the specific <code class="computeroutput"><a class="link" href="../boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code>
- type using a template parameter. For example (see also identity.cpp):
+ template which can hold the specific <code class="computeroutput"><a class="link" href="../boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code>
+ type using a template parameter. For example (see also make_call.cpp
+ and identity.hpp):
       </p>
 <p>
 </p>
 <pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">F</span><span class="special">&gt;</span>
 <span class="keyword">void</span> <span class="identifier">check</span><span class="special">(</span><span class="identifier">F</span> <span class="identifier">identity</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="string">"abc"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abc"</span> <span class="special">);</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span> <span class="special">);</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="number">1.23</span><span class="special">)</span> <span class="special">==</span> <span class="number">1.23</span> <span class="special">);</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity</span><span class="special">(</span><span class="string">"abc"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abc"</span><span class="special">);</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span><span class="special">);</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity</span><span class="special">(</span><span class="number">1.23</span><span class="special">)</span> <span class="special">==</span> <span class="number">1.23</span><span class="special">);</span>
 <span class="special">}</span>
 </pre>
 <p>
@@ -162,6 +165,27 @@
 </pre>
 <p>
       </p>
+<p>
+ The library implementation of <code class="computeroutput"><a class="link" href="../boost/make_overloaded_function.html" title="Function template make_overloaded_function">boost::make_overloaded_function</a></code>
+ uses Boost.Typeof
+ to automatically deduce some of the function types. In order to compile code
+ in Boost.Typeof
+ emulation mode, all types should be properly registered using <code class="computeroutput"><span class="identifier">BOOST_TYPEOF_REGISTER_TYPE</span></code> and <code class="computeroutput"><span class="identifier">BOOST_TYPEOF_REGISTER_TEMPLATE</span></code>, or appropriate
+ Boost.Typeof headers
+ should be included (see Boost.Typeof
+ for more information). For the above examples, it is sufficient to include
+ the Boost.Typeof
+ header that registers <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></code>
+ (this library does not require to register <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span></code>
+ for Boost.Typeof
+ emulation):
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">typeof</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">string</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// No need to register `boost::function`.</span>
+</pre>
+<p>
+ </p>
 </div>
 <div class="footnotes">
 <br><hr width="100" align="left">
@@ -177,6 +201,8 @@
           pointers and function references). Finally, monomorphic function objects
           are instances of classes with a non-template call operator of the form
           <code class="literal"><span class="emphasis"><em>result-type </em></span></code><code class="computeroutput"><span class="keyword">operator</span><span class="special">()(</span></code><code class="literal"><span class="emphasis"><em>argument1-type</em></span></code><code class="computeroutput"><span class="special">,</span> <span class="special">...)</span></code>.
+ Unfortunately, it is not possible to support polymorphic function objects
+ (see http://lists.boost.org/Archives/boost/2012/03/191744.php).
         </p></div>
 <div class="footnote"><p><sup>[<a id="ftn.boost_functional_overloadedfunction.Tutorial.overloading.f1" href="#boost_functional_overloadedfunction.Tutorial.overloading.f1" class="para">3</a>] </sup>
           Note that in C++ the function result type is not used for overload resolution

Modified: branches/release/libs/functional/overloaded_function/doc/html/index.html
==============================================================================
--- /trunk/libs/functional/overloaded_function/doc/html/index.html (original)
+++ branches/release/libs/functional/overloaded_function/doc/html/index.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -66,11 +66,12 @@
 <a name="boost_functional_overloadedfunction.Introduction"></a><a class="link" href="index.html#boost_functional_overloadedfunction.Introduction" title="Introduction">Introduction</a>
 </h2></div></div></div>
 <p>
- Consider the following functions with distinct signatures:
+ Consider the following functions which have distinct signatures:
     </p>
 <p>
 </p>
-<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">identity_s</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">x</span><span class="special">;</span> <span class="special">}</span> <span class="comment">// As pointer.</span>
+<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">identity_s</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="comment">// Function (as pointer).</span>
+ <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">x</span><span class="special">;</span> <span class="special">}</span>
 
 <span class="keyword">int</span> <span class="identifier">identity_i_impl</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">x</span><span class="special">;</span> <span class="special">}</span>
 <span class="keyword">int</span> <span class="special">(&amp;</span><span class="identifier">identity_i</span><span class="special">)(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">=</span> <span class="identifier">identity_i_impl</span><span class="special">;</span> <span class="comment">// Function reference.</span>
@@ -81,15 +82,15 @@
 <p>
     </p>
 <p>
- Instead of calling them using their separate names (here <code class="computeroutput"><span class="identifier">BOOST_CHECK</span></code>
+ Instead of calling them using their separate names (here <code class="computeroutput"><span class="identifier">BOOST_TEST</span></code>
       is equivalent to <code class="computeroutput"><span class="identifier">assert</span></code>):
       <sup>[<a name="boost_functional_overloadedfunction.Introduction.f0" href="#ftn.boost_functional_overloadedfunction.Introduction.f0" class="footnote">1</a>]</sup>
     </p>
 <p>
 </p>
-<pre class="programlisting"><span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity_s</span><span class="special">(</span><span class="string">"abc"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abc"</span> <span class="special">);</span>
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity_i</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span> <span class="special">);</span>
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity_d</span><span class="special">(</span><span class="number">1.23</span><span class="special">)</span> <span class="special">==</span> <span class="number">1.23</span> <span class="special">);</span>
+<pre class="programlisting"><span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity_s</span><span class="special">(</span><span class="string">"abc"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abc"</span><span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity_i</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span><span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity_d</span><span class="special">(</span><span class="number">1.23</span><span class="special">)</span> <span class="special">==</span> <span class="number">1.23</span><span class="special">);</span>
 </pre>
 <p>
     </p>
@@ -97,7 +98,8 @@
       It is possible to use this library to create a single overloaded
       function object (or functor)
       named <code class="computeroutput"><span class="identifier">identity</span></code> that aggregates
- together the calls to the specific functions (see also identity.cpp):
+ together the calls to the specific functions (see also functor.cpp
+ and identity.hpp):
     </p>
 <p>
 </p>
@@ -108,9 +110,9 @@
 <span class="special">&gt;</span> <span class="identifier">identity</span><span class="special">(</span><span class="identifier">identity_s</span><span class="special">,</span> <span class="identifier">identity_i</span><span class="special">,</span> <span class="identifier">identity_d</span><span class="special">);</span>
 
 <span class="comment">// All calls via single `identity` function.</span>
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="string">"abc"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abc"</span> <span class="special">);</span>
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span> <span class="special">);</span>
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="number">1.23</span><span class="special">)</span> <span class="special">==</span> <span class="number">1.23</span> <span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity</span><span class="special">(</span><span class="string">"abc"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abc"</span><span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span><span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">identity</span><span class="special">(</span><span class="number">1.23</span><span class="special">)</span> <span class="special">==</span> <span class="number">1.23</span><span class="special">);</span>
 </pre>
 <p>
     </p>
@@ -124,16 +126,19 @@
 <div class="footnotes">
 <br><hr width="100" align="left">
 <div class="footnote"><p><sup>[<a id="ftn.boost_functional_overloadedfunction.Introduction.f0" href="#boost_functional_overloadedfunction.Introduction.f0" class="para">1</a>] </sup>
- In the examples presented in this documentation, <code class="computeroutput"><span class="identifier">BOOST_CHECK</span></code>
- is used instead of <code class="computeroutput"><span class="identifier">assert</span></code>
- because it allows to write regression tests using Boost.Test.
- The examples of this documentation are executed as part of the library test
- suite to verify that they always compile and run correctly.
+ In most of the examples presented in this documentation, the Boost.Detail/LightweightTest
+ (<code class="literal">boost/detail/lightweight_test.hpp</code>) macro <code class="computeroutput"><span class="identifier">BOOST_TEST</span></code> is used to check correctness
+ conditions (conceptually similar to <code class="computeroutput"><span class="identifier">assert</span></code>).
+ A failure of the checked condition does not abort the execution of the program,
+ it will instead make <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span></code>
+ return a non-zero program exit code. Using Boost.Detail/LightweightTest allows
+ to add the examples to the library regression tests so to make sure that
+ they always compile and run correctly.
       </p></div>
 </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:16:51 GMT</small></p></td>
+<td align="left"><p><small>Last revised: April 13, 2012 at 00:59:44 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: branches/release/libs/functional/overloaded_function/doc/html/reference.html
==============================================================================
--- /trunk/libs/functional/overloaded_function/doc/html/reference.html (original)
+++ branches/release/libs/functional/overloaded_function/doc/html/reference.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -32,7 +32,7 @@
 <div class="section header_boost_functional_overloaded_function_hpp">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="header.boost.functional.overloaded_function_hpp"></a>Header &lt;boost/functional/overloaded_function.hpp&gt;</h3></div></div></div>
-<p>Overload distinct function pointers, function references, and function objects into a single function object. </p>
+<p>Overload distinct function pointers, function references, and monomorphic function objects into a single function object. </p>
 <pre class="synopsis"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
   <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> F1<span class="special">,</span> <span class="keyword">typename</span> F2<span class="special">,</span> <span class="special">...</span> <span class="special">&gt;</span> <span class="keyword">class</span> <a class="link" href="boost/overloaded_function.html" title="Class template overloaded_function">overloaded_function</a><span class="special">;</span>
   <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> F1<span class="special">,</span> <span class="keyword">typename</span> F2<span class="special">,</span> <span class="special">...</span> <span class="special">&gt;</span>

Modified: branches/release/libs/functional/overloaded_function/doc/overloaded_function.qbk
==============================================================================
--- /trunk/libs/functional/overloaded_function/doc/overloaded_function.qbk (original)
+++ branches/release/libs/functional/overloaded_function/doc/overloaded_function.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -19,47 +19,57 @@
     [category Function Objects and Higher-Order Programming]
 ]
 
-[def __Introduction__ [link functional_overloaded_function.Introduction Introduction]]
-[def __Getting_Started__ [link functional_overloaded_function.Getting_Started Getting Started]]
-[def __Tutorial__ [link functional_overloaded_function.Tutorial Tutorial]]
+[def __Introduction__ [link functional_overloaded_function.introduction Introduction]]
+[def __Getting_Started__ [link functional_overloaded_function.getting_started Getting Started]]
+[def __Tutorial__ [link functional_overloaded_function.tutorial Tutorial]]
 [def __Boost__ [@http://www.boost.org Boost]]
 [def __Boost_Test__ [@http://www.boost.org/libs/test Boost.Test]]
 [def __Boost_Function__ [@http://www.boost.org/libs/function Boost.Function]]
 [def __Boost_Typeof__ [@http://www.boost.org/doc/libs/typeof Boost.Typeof]]
 
-[import ../test/identity.cpp]
+[import ../test/identity.hpp]
+[import ../test/functor.cpp]
+[import ../test/make_decl.cpp]
+[import ../test/make_call.cpp]
 
 This library allows to overload different functions into a single function object.
 
-[section:Introduction Introduction]
+[section Introduction]
 
-Consider the following functions with distinct signatures:
+Consider the following functions which have distinct signatures:
 
 [identity_decls]
 
-Instead of calling them using their separate names (here `BOOST_CHECK` is equivalent to `assert`):
+Instead of calling them using their separate names (here `BOOST_TEST` is equivalent to `assert`):
 [footnote
-In the examples presented in this documentation, `BOOST_CHECK` is used instead of `assert` because it allows to write regression tests using __Boost_Test__.
-The examples of this documentation are executed as part of the library test suite to verify that they always compile and run correctly.
+In most of the examples presented in this documentation, the Boost.Detail/LightweightTest (=boost/detail/lightweight_test.hpp=) macro `BOOST_TEST` is used to check correctness conditions (conceptually similar to `assert`).
+A failure of the checked condition does not abort the execution of the program, it will instead make `boost::report_errors` return a non-zero program exit code.
+Using Boost.Detail/LightweightTest allows to add the examples to the library regression tests so to make sure that they always compile and run correctly.
 ]
 
 [identity_calls]
 
-It is possible to use this library to create a single [@http://en.wikipedia.org/wiki/Function_overloading overloaded] function object (or [@http://en.wikipedia.org/wiki/Functor functor]) named `identity` that aggregates together the calls to the specific functions (see also [@../../test/identity.cpp =identity.cpp=]):
+It is possible to use this library to create a single [@http://en.wikipedia.org/wiki/Function_overloading overloaded] function object (or [@http://en.wikipedia.org/wiki/Functor functor]) named `identity` that aggregates together the calls to the specific functions (see also [@../../test/functor.cpp =functor.cpp=] and [@../../test/identity.hpp =identity.hpp=]):
 
-[identity]
+[identity_functor]
 
 Note how the functions are called via a single overloaded function object `identity` instead of using their different names `identity_s`, `identity_i`, and `identity_d`.
 
 [endsect]
 
-[section:Getting_Started Getting Started]
+[section Getting Started]
 
 This section explains how to setup a system to use this library.
 
 [section Compilers and Platforms]
 
-The library was tested by the authors on GCC 4.5.3 (with and without C++11 features [^-std=c++0x]) and MSVC 8.0 under Linux, Cygwin, and Windows 7.
+The authors originally developed and tested this library on:
+
+# GNU Compiler Collection (GCC) C++ 4.5.3 (with and without C++11 features enabled `-std=c++0x`) on Cygwin.
+# Miscrosoft Visual C++ (MSVC) 8.0 on Windows 7.
+
+See the library [@http://www.boost.org/development/tests/release/developer/functional-overloaded_function.html regressions test results] for detailed information on supported compilers and platforms.
+Check the library regression test [@../../test/Jamfile.v2 =Jamfile.v2=] for any special configuration that might be required for a specific compiler.
 
 [endsect]
 
@@ -70,28 +80,28 @@
 Programmers can simply instruct the compiler where to find the library header files (`-I` option on GCC, `/I` option on MSVC, etc) and compile code using the library.
 
 The maximum number of functions to overload is given by the [macroref BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX] configuration macro.
-The maximum number of function parameters for each of the specified function types is given by the [macroref BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX] configuration macro.
-All configuration macros have appropriate default values when they are left undefined by the user.
+The maximum number of function parameters for each of the specified function type is given by the [macroref BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX] configuration macro.
+All configuration macros have appropriate default values when they are left undefined.
 
 [endsect]
 
 [endsect]
 
-[section:Tutorial Tutorial]
+[section Tutorial]
 
 This section explains how to use this library.
 
 [section Overloading]
 
-Consider the following functions with distinct signatures:
+Consider the following functions which have distinct signatures:
 
 [identity_decls]
 
-This library header [headerref boost/functional/overloaded_function.hpp] provides a [classref boost::overloaded_function] class template that creates a single overloaded function object that can be used to call the specified functions instead of using the separate function names (see also [@../../test/identity.cpp =identity.cpp=]):
+This library header [headerref boost/functional/overloaded_function.hpp] provides a [classref boost::overloaded_function] class template that creates a single overloaded function object that can be used to call the specified functions instead of using the separate function names (see also [@../../test/functor.cpp =functor.cpp=] and [@../../test/identity.hpp =identity.hpp=]):
 
-[identity]
+[identity_functor]
 
-Note how function types in the following format are passed as template parameters to [classref boost::overloaded_function] (this is the format of __Boost_Function__'s preferred syntax):
+Note how each function type is passed as a template parameter of [classref boost::overloaded_function] using the following syntax (this is __Boost_Function__'s preferred syntax):
 
     ``/result-type/`` (``/argument1-type/``, ``/argument2-type/``, ...)
 
@@ -101,8 +111,9 @@
 Function references are of the form [^['result-type ]]`(&)(`[^['argument1-type]]`, ...)`.
 Function types are of the form [^['result-type ]]`(`[^['argument1-type]]`, ...)` (note how they lack of both `*` and `&` when compared to function pointers and function references).
 Finally, monomorphic function objects are instances of classes with a non-template call operator of the form [^['result-type ]]`operator()(`[^['argument1-type]]`, ...)`.
+Unfortunately, it is not possible to support polymorphic function objects (see [@http://lists.boost.org/Archives/boost/2012/03/191744.php]).
 ]
-In the above example, `identity_s` is passed as function pointer (the function address is automatically taken from the function name by compiler), `identity_i` as function reference, and `identity_d` as function object.
+In the above example, `identity_s` is passed as a function pointer (the function address is automatically taken from the function name by the compiler), `identity_i` as a function reference, and `identity_d` as a function object.
 
 All specified function types must have distinct parameters from one another (so the overloaded calls can be resolved by this library).
 [footnote
@@ -119,26 +130,32 @@
 The function types are automatically deduced from the specified functions and the appropriate [classref boost::overloaded_function] instantiation is returned by [funcref boost::make_overloaded_function].
 
 The [funcref boost::make_overloaded_function] function template can be useful when used together with __Boost_Typeof__'s `BOOST_AUTO` (or C++11 `auto`).
-For example (see also [@../../test/identity.cpp =identity.cpp=]):
+For example (see also [@../../test/make_decl.cpp =make_decl.cpp=] and [@../../test/identity.hpp =identity.hpp=]):
 
-[identity_make]
+[identity_make_decl]
 
 Note how the overloaded function object `identity` has been created specifying only the functions `identity_s`, `identity_i`, `identity_d` and without specifying the function types `const std::string& (const std::string&)`, `int (int)`, and `double (double)` as required instead by [classref boost::overloaded_function].
 Therefore, [funcref boost::make_overloaded_function] provides a more concise syntax in this context when compared with [classref boost::overloaded_function].
 
-Another case where [funcref boost::make_overloaded_function] can be useful is when the overloaded function object is passed to a function template which can hide the specific [classref boost::overloaded_function] type using a template parameter.
-For example (see also [@../../test/identity.cpp =identity.cpp=]):
+Another case where [funcref boost::make_overloaded_function] can be useful is when the overloaded function object is passed to a function template which can hold the specific [classref boost::overloaded_function] type using a template parameter.
+For example (see also [@../../test/make_call.cpp =make_call.cpp=] and [@../../test/identity.hpp =identity.hpp=]):
 
 [identity_make_checks]
 [identity_make_call]
 
+The library implementation of [funcref boost::make_overloaded_function] uses __Boost_Typeof__ to automatically deduce some of the function types.
+In order to compile code in __Boost_Typeof__ emulation mode, all types should be properly registered using `BOOST_TYPEOF_REGISTER_TYPE` and `BOOST_TYPEOF_REGISTER_TEMPLATE`, or appropriate __Boost_Typeof__ headers should be included (see __Boost_Typeof__ for more information).
+For the above examples, it is sufficient to include the __Boost_Typeof__ header that registers `std::string` (this library does not require to register `boost::function` for __Boost_Typeof__ emulation):
+
+[identity_typeof]
+
 [endsect]
 
 [endsect]
 
 [xinclude reference.xml]
 
-[section:Acknowledgments Acknowledgments]
+[section Acknowledgments]
 
 Many thanks to Mathias Gaunard for suggesting to implement [classref boost::overloaded_function] and for some sample code.
 

Modified: branches/release/libs/functional/overloaded_function/test/Jamfile.v2
==============================================================================
--- /trunk/libs/functional/overloaded_function/test/Jamfile.v2 (original)
+++ branches/release/libs/functional/overloaded_function/test/Jamfile.v2 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,7 +7,10 @@
 
 import testing ;
 
-project : requirements <library>/boost//unit_test_framework ;
+# Sun does not automatically detect type-of emulation (force it).
+project : requirements <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
 
-run identity.cpp ;
+run functor.cpp ;
+run make_decl.cpp ;
+run make_call.cpp ;
 

Copied: branches/release/libs/functional/overloaded_function/test/functor.cpp (from r77586, /trunk/libs/functional/overloaded_function/test/functor.cpp)
==============================================================================
--- /trunk/libs/functional/overloaded_function/test/functor.cpp (original)
+++ branches/release/libs/functional/overloaded_function/test/functor.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,14 +7,13 @@
 
 #include "identity.hpp"
 #include <boost/functional/overloaded_function.hpp>
-#define BOOST_TEST_MODULE TestFunctor
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE(test_functor) {
+int main() {
     //[identity_calls
- BOOST_CHECK(identity_s("abc") == "abc");
- BOOST_CHECK(identity_i(123) == 123);
- BOOST_CHECK(identity_d(1.23) == 1.23);
+ BOOST_TEST(identity_s("abc") == "abc");
+ BOOST_TEST(identity_i(123) == 123);
+ BOOST_TEST(identity_d(1.23) == 1.23);
     //]
 
     //[identity_functor
@@ -25,9 +24,11 @@
> identity(identity_s, identity_i, identity_d);
 
     // All calls via single `identity` function.
- BOOST_CHECK(identity("abc") == "abc");
- BOOST_CHECK(identity(123) == 123);
- BOOST_CHECK(identity(1.23) == 1.23);
+ BOOST_TEST(identity("abc") == "abc");
+ BOOST_TEST(identity(123) == 123);
+ BOOST_TEST(identity(1.23) == 1.23);
     //]
+
+ return boost::report_errors();
 }
 

Deleted: /trunk/libs/functional/overloaded_function/test/identity.cpp
==============================================================================
--- /trunk/libs/functional/overloaded_function/test/identity.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,70 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/functional/overloaded_function
-
-#include <boost/functional/overloaded_function.hpp>
-#include <boost/function.hpp>
-#define BOOST_TEST_MODULE TestIdentity
-#include <boost/test/unit_test.hpp>
-#include <string>
-
-//[identity_make_checks
-template<typename F>
-void check(F identity) {
- BOOST_CHECK( identity("abc") == "abc" );
- BOOST_CHECK( identity(123) == 123 );
- BOOST_CHECK( identity(1.23) == 1.23 );
-}
-//]
-
-//[identity_decls
-const std::string& identity_s(const std::string& x) { return x; } // As pointer.
-
-int identity_i_impl(int x) { return x; }
-int (&identity_i)(int) = identity_i_impl; // Function reference.
-
-double identity_d_impl(double x) { return x; }
-boost::function<double (double)> identity_d = identity_d_impl; // Functor.
-//]
-
-BOOST_AUTO_TEST_CASE( test_identity ) {
- //[identity_calls
- BOOST_CHECK( identity_s("abc") == "abc" );
- BOOST_CHECK( identity_i(123) == 123 );
- BOOST_CHECK( identity_d(1.23) == 1.23 );
- //]
-
- {
- //[identity
- boost::overloaded_function<
- const std::string& (const std::string&)
- , int (int)
- , double (double)
- > identity(identity_s, identity_i, identity_d);
-
- // All calls via single `identity` function.
- BOOST_CHECK( identity("abc") == "abc" );
- BOOST_CHECK( identity(123) == 123 );
- BOOST_CHECK( identity(1.23) == 1.23 );
- //]
- }
-
- {
- //[identity_make
- BOOST_AUTO(identity, boost::make_overloaded_function(
- identity_s, identity_i, identity_d));
-
- BOOST_CHECK( identity("abc") == "abc" );
- BOOST_CHECK( identity(123) == 123 );
- BOOST_CHECK( identity(1.23) == 1.23 );
- //]
- }
-
- //[identity_make_call
- check(boost::make_overloaded_function(identity_s, identity_i, identity_d));
- //]
-}
-

Copied: branches/release/libs/functional/overloaded_function/test/identity.hpp (from r77586, /trunk/libs/functional/overloaded_function/test/identity.hpp)
==============================================================================
--- /trunk/libs/functional/overloaded_function/test/identity.hpp (original)
+++ branches/release/libs/functional/overloaded_function/test/identity.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -8,11 +8,15 @@
 #ifndef IDENTITY_HPP_
 #define IDENTITY_HPP_
 
+//[identity_typeof
+#include <boost/typeof/std/string.hpp> // No need to register `boost::function`.
+//]
 #include <boost/function.hpp>
 #include <string>
 
 //[identity_decls
-const std::string& identity_s(const std::string& x) { return x; } // As pointer.
+const std::string& identity_s(const std::string& x) // Function (as pointer).
+ { return x; }
 
 int identity_i_impl(int x) { return x; }
 int (&identity_i)(int) = identity_i_impl; // Function reference.

Copied: branches/release/libs/functional/overloaded_function/test/make_call.cpp (from r77586, /trunk/libs/functional/overloaded_function/test/make_call.cpp)
==============================================================================
--- /trunk/libs/functional/overloaded_function/test/make_call.cpp (original)
+++ branches/release/libs/functional/overloaded_function/test/make_call.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,21 +7,21 @@
 
 #include "identity.hpp"
 #include <boost/functional/overloaded_function.hpp>
-#define BOOST_TEST_MODULE TestMakeCall
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
 //[identity_make_checks
 template<typename F>
 void check(F identity) {
- BOOST_CHECK(identity("abc") == "abc");
- BOOST_CHECK(identity(123) == 123);
- BOOST_CHECK(identity(1.23) == 1.23);
+ BOOST_TEST(identity("abc") == "abc");
+ BOOST_TEST(identity(123) == 123);
+ BOOST_TEST(identity(1.23) == 1.23);
 }
 //]
 
-BOOST_AUTO_TEST_CASE(test_identity) {
+int main() {
     //[identity_make_call
     check(boost::make_overloaded_function(identity_s, identity_i, identity_d));
     //]
+ return boost::report_errors();
 }
 

Copied: branches/release/libs/functional/overloaded_function/test/make_decl.cpp (from r77586, /trunk/libs/functional/overloaded_function/test/make_decl.cpp)
==============================================================================
--- /trunk/libs/functional/overloaded_function/test/make_decl.cpp (original)
+++ branches/release/libs/functional/overloaded_function/test/make_decl.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,17 +7,18 @@
 
 #include "identity.hpp"
 #include <boost/functional/overloaded_function.hpp>
-#define BOOST_TEST_MODULE TestMakeDecl
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE(test_make_decl) {
- //[identity_make
+int main() {
+ //[identity_make_decl
     BOOST_AUTO(identity, boost::make_overloaded_function(
             identity_s, identity_i, identity_d));
 
- BOOST_CHECK(identity("abc") == "abc");
- BOOST_CHECK(identity(123) == 123);
- BOOST_CHECK(identity(1.23) == 1.23);
+ BOOST_TEST(identity("abc") == "abc");
+ BOOST_TEST(identity(123) == 123);
+ BOOST_TEST(identity(1.23) == 1.23);
     //]
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/libraries.htm
==============================================================================
--- branches/release/libs/libraries.htm (original)
+++ branches/release/libs/libraries.htm 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -148,6 +148,8 @@
     <li>functional/hash -
         A TR1 hash function object that can be extended to hash user defined
         types, from Daniel James.</li>
+ <li>functional/overloaded_function -
+ Overload different functions into a single function object, from Lorenzo Caminiti.</li>
     <li>fusion -
         Library for working with tuples, including various containers, algorithms, etc.
         From Joel de Guzman, Dan Marsden and Tobias Schwinger.</li>
@@ -163,6 +165,8 @@
     <li>icl -
         Interval Container Library, interval sets and maps and aggregation
         of associated values, from Joachim Faulhaber.</li>
+ <li>identity_type -
+ Wrap types within round parenthesis so they can always be passed as macro parameters, from Lorenzo Caminiti.</li>
     <li>integer - Headers to ease
         dealing with integral types.</li>
     <li>interprocess - Shared memory, memory mapped files,
@@ -181,6 +185,8 @@
     <li>lambda - Define small unnamed
     function objects at the actual call site, and more, from Jaakko J&auml;rvi and
     Gary Powell.</li>
+ <li>local_function -
+ Program functions locally, within other functions, directly within the scope where they are needed, from Lorenzo Caminiti.</li>
     <li>locale - Provide localization and Unicode
     handling tools for C++, from Artyom Beilis</li>
     <li>lexical_cast -&nbsp; General literal text conversions, such as an <code>int</code> represented as
@@ -271,8 +277,8 @@
     <li>regex - Regular expression
         library, from John Maddock.</li>
     <li>result_of - determines the type of a function call expression.</li>
- <li>scope_exit
- - Execute arbitrary code at scope exit, from Alexander Nasonov.</li>
+ <li>scope_exit -
+ Execute arbitrary code at scope exit, from Alexander Nasonov and Lorenzo Caminiti.</li>
     <li>serialization
         - Serialization for persistence and marshalling, from Robert Ramey</li>
     <li>signals - managed signals &amp;
@@ -514,9 +520,13 @@
     <li>functional/hash -
         A TR1 hash function object that can be extended to hash user defined
         types, from Daniel James.</li>
+ <li>functional/overloaded_function -
+ Overload different functions into a single function object, from Lorenzo Caminiti.</li>
     <li>lambda - Define small unnamed
     function objects at the actual call site, and more, from Jaakko J&auml;rvi and
     Gary Powell.</li>
+ <li>local_function -
+ Program functions locally, within other functions, directly within the scope where they are needed, from Lorenzo Caminiti.</li>
     <li>Phoenix - Define small unnamed
     function objects at the actual call site, and more, from Joel de Guzman, Dan
     Marsden and Thomas Heller</li>
@@ -630,8 +640,8 @@
     "parameter/doc/html/index.html">parameter</a></span> -
     Write functions that accept arguments by name, by David Abrahams
     and Daniel Wallin.</li>
- <li>scope_exit
- - Execute arbitrary code at scope exit, from Alexander Nasonov.</li>
+ <li>scope_exit -
+ Execute arbitrary code at scope exit, from Alexander Nasonov and Lorenzo Caminiti.</li>
     <li>typeof -
         Typeof operator emulation, from Arkadiy Vertleyb and Peder Holt.</li>
 </ul>
@@ -754,6 +764,8 @@
 <h3><a name="Preprocessor">Preprocessor</a> Metaprogramming</h3>
 
 <ul>
+ <li>identity_type -
+ Wrap types within round parenthesis so they can always be passed as macro parameters, from Lorenzo Caminiti.</li>
     <li>preprocessor - Preprocessor
     metaprogramming tools including repetition and recursion, from Vesa Karvonen
     and Paul Mensonides.</li>

Modified: branches/release/libs/local_function/doc/Jamfile.v2
==============================================================================
--- /trunk/libs/local_function/doc/Jamfile.v2 (original)
+++ branches/release/libs/local_function/doc/Jamfile.v2 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -17,7 +17,7 @@
         <doxygen:param>WARN_IF_UNDOCUMENTED=NO
         <doxygen:param>HIDE_UNDOC_MEMBERS=YES
         <doxygen:param>HIDE_UNDOC_CLASSES=YES
- <doxygen:param>ALIASES=" Params=\"<b>Parameters:</b> <table border="0">\" Param{2}=\"<tr><td><b><tt>\\1</tt></b></td><td>\\2</td></tr>\" EndParams=\"</table>\" Returns=\"<b>Returns:</b>\" Note=\"<b>Note:</b>\" Warning=\"<b>Warning:</b>\" See=\"<b>See:</b>\" RefSect{1}=\"\\xmlonly<link linkend='boost_localfunction.\\1'>\\1</link>\\endxmlonly\" RefSectId{2}=\"\\xmlonly<link linkend='boost_localfunction.\\1'>\\2</link>\\endxmlonly\" RefClass{1}=\"\\xmlonly<computeroutput><classname alt='\\1'>\\1</classname></computeroutput>\\endxmlonly\" RefFunc{1}=\"\\xmlonly<computeroutput><functionname alt='\\1'>\\1</functionname></computeroutput>\\endxmlonly\" RefMacro{1}=\"\\xmlonly<computeroutput><macroname alt='\\1'>\\1</macroname></computeroutput>\\endxmlonly\" "
+ <doxygen:param>ALIASES=" Params=\"<b>Parameters:</b> <table border="0">\" Param{2}=\"<tr><td><b><tt>\\1</tt></b></td><td>\\2</td></tr>\" EndParams=\"</table>\" Returns=\"<b>Returns:</b>\" Note=\"<b>Note:</b>\" Warning=\"<b>Warning:</b>\" See=\"<b>See:</b>\" RefSect{2}=\"\\xmlonly<link linkend='boost_localfunction.\\1'>\\2</link>\\endxmlonly\" RefClass{1}=\"\\xmlonly<computeroutput><classname alt='\\1'>\\1</classname></computeroutput>\\endxmlonly\" RefFunc{1}=\"\\xmlonly<computeroutput><functionname alt='\\1'>\\1</functionname></computeroutput>\\endxmlonly\" RefMacro{1}=\"\\xmlonly<computeroutput><macroname alt='\\1'>\\1</macroname></computeroutput>\\endxmlonly\" "
     ;
 
 xml qbk : local_function.qbk

Modified: branches/release/libs/local_function/doc/acknowledgements.qbk
==============================================================================
--- /trunk/libs/local_function/doc/acknowledgements.qbk (original)
+++ branches/release/libs/local_function/doc/acknowledgements.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,11 +5,11 @@
 [/ http://www.boost.org/LICENSE_1_0.txt) ]
 [/ Home at http://www.boost.org/libs/local_function ]
 
-[section:Acknowledgments Acknowledgments]
+[section Acknowledgments]
 
 This section aims to recognize the contributions of /all/ the different people that participated directly or indirectly to the design and development of this library.
 
-Many thanks to Steven Watanabe and Vicente Botet for suggesting to me to use __Boost_ScopeExit__ binding to [@http://boost.2283326.n4.nabble.com/contract-diff-n1962-tt2671482.html#none emulate local functions].
+Many thanks to Steven Watanabe and Vicente Botet for suggesting to me to use __Boost_ScopeExit__ binding to [@http://lists.boost.org/Archives/boost/2010/04/165149.php emulate local functions].
 Many thanks to Alexander Nasonov for clarifying how __Boost_ScopeExit__ binding could be used to implement local functions and for some [@http://thread.gmane.org/gmane.comp.lib.boost.devel/168612 early work] in this direction.
 
 Many thanks to Gregory Crosswhite for using an early version of this library in [@https://github.com/gcross/CodeSearch one of his projects].
@@ -25,9 +25,9 @@
 
 Thanks to Steven Watanabe, Vicente Botet, Michael Caisse, Yechezkel Mett, Joel de Guzman, Thomas Heller, et al. for helping with the __Alternatives__ section and with the profiling of the different alternatives.
 
-Many thanks to the library's [@http://lists.boost.org/boost-announce/2011/12/0340.php Boost review] manager: Jeffrey Lee Hellrung.
-Thanks also to all the people that submitted a (positive and negative) review: Andrzej Krzemienski, Edward Diener, Gregory Crosswhite, John Bytheway, Hartmut Kaiser, Krzysztof Czainski, Nat Lindon, Pierre Morcello, Thomas Heller, and Vicente J. Botet.
-Thanks to everyone else that commented (positively and negatively) on the library during its Boost review.
+Many thanks to Jeffrey Lee Hellrung for managing the [@http://lists.boost.org/boost-announce/2011/12/0340.php Boost review] of this library.
+Thanks also to all the people that submitted a Boost review: Andrzej Krzemienski, Edward Diener, Gregory Crosswhite, John Bytheway, Hartmut Kaiser, Krzysztof Czainski, Nat Lindon, Pierre Morcello, Thomas Heller, and Vicente J. Botet.
+Thanks to everyone that commented on the library during its Boost review.
 
 Finally, many thanks to the entire __Boost__ community and [@http://lists.boost.org mailing list] for providing valuable comments about this library and great insights on the C++ programming language.
 

Modified: branches/release/libs/local_function/doc/advanced_topics.qbk
==============================================================================
--- /trunk/libs/local_function/doc/advanced_topics.qbk (original)
+++ branches/release/libs/local_function/doc/advanced_topics.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,19 +5,20 @@
 [/ http://www.boost.org/LICENSE_1_0.txt) ]
 [/ Home at http://www.boost.org/libs/local_function ]
 
-[section:Advanced_Topics Advanced Topics]
+[section Advanced Topics]
 
-This section illustrates advanced usages of this library (at the bottom there is also a list of known limitations of the library).
+This section illustrates advanced usage of this library.
+At the bottom there is also a list of known limitations of this library.
 
 [section Default Parameters]
 
-This library also allows to specify default values for the local function parameters.
+This library allows to specify default values for the local function parameters.
 However, the usual C++ syntax for default parameters that uses the assignment symbol `=` cannot be used.
 [footnote
 *Rationale.*
 The assignment symbol `=` cannot be used to specify default parameter values because default values are not part of the parameter type so they cannot be handled using template meta-programming.
 Default parameter values need to be separated from the rest of the parameter declaration using the preprocessor.
-Specifically, this library needs to use preprocessor meta-programming to remove default values when constructing the local function type and then to count the number of default values to provide the correct set of call operators for the local functor.
+Specifically, this library needs to use preprocessor meta-programming to remove default values when constructing the local function type and also to count the number of default values to provide the correct set of call operators for the local functor.
 Therefore, the symbol `=` cannot be used because it cannot be handled by preprocessor meta-programming (non-alphanumeric symbols cannot be detected by preprocessor meta-programming because they cannot be concatenated by the preprocessor).
 ]
 The keyword `default` is used instead:
@@ -28,10 +29,10 @@
 
 [add_default]
 
-Programmers can define a `WITH_DEFAULT` macro similar to the following if they think it improves readability over the syntax above (see also [@../../test/add_with_default.cpp =add_with_default.cpp=]):
+Programmers can define a `WITH_DEFAULT` macro similar to the following if they think it improves readability over the above syntax (see also [@../../test/add_with_default.cpp =add_with_default.cpp=]):
 [footnote
 The authors do not personally find the use of the `WITH_DEFAULT` macro more readable and they prefer to use the `default` keyword directly.
-Furthermore, `WITH_DEFAULT` needs to be defined differently for compilers without variadic macros `#define WITH_DEFAULT (default)` so it can only be defined by programmers based on the syntax they decide to use.
+Furthermore, `WITH_DEFAULT` needs to be defined differently for compilers without variadic macros `#define WITH_DEFAULT (default)` so it can only be defined by programmers based on the syntax they decide to use (see the __No_Variadic_Macros__ section).
 ]
 
 [add_with_default_macro]
@@ -42,7 +43,7 @@
 [section Commas and Symbols in Macros]
 
 The C++ preprocessor does not allow commas `,` within macro parameters unless they are wrapped by round parenthesis `()` (see the __Boost_Utility_IdentityType__ documentation for details).
-Therefore, using commas within the local function parameters and bindings will generate (cryptic) preprocessor errors unless they are wrapped with an extra set of round parenthesis `()` as explained here.
+Therefore, using commas within local function parameters and bindings will generate (cryptic) preprocessor errors unless they are wrapped with an extra set of round parenthesis `()` as explained here.
 
 [note
 Also macro parameters with commas wrapped by angular parenthesis `<>` (templates, etc) or square parenthesis `[]` (multidimensional array access, etc) need to be wrapped by the extra round parenthesis `()` as explained here (this is because the preprocessor only recognizes the round parenthesis and it does not recognize angular, square, or any other type of parenthesis).
@@ -74,7 +75,7 @@
 The preprocessor always interprets unwrapped commas as separating macro parameters.
 Thus in this case the comma will indicate to the preprocessor that the first macro parameter is `const std::map<std::tring`, the second macro parameter is `size_t>& m`, etc instead of passing `const std::map<std::string, size_t>& m` as a single macro parameter.
 ]
-The __Boost_Utility_IdentityType__ macro `BOOST_IDENTITY_TYPE(`[^['parenthesized-type]]`)` from the header =boost/utility/identity_type.hpp= can be used to wrap a type within extra parenthesis `()` so to overcome the problem:
+The __Boost_Utility_IdentityType__ macro `BOOST_IDENTITY_TYPE((`[^['type-with-commas]]`))` defined in the =boost/utility/identity_type.hpp= header can be used to wrap a type within extra parenthesis `()` so to overcome this problem:
 
     #include <boost/utility/identity_type.hpp>
     
@@ -85,7 +86,7 @@
         ...
     } BOOST_LOCAL_FUNCTION_NAME(f)
 
-This macro expands to an expression that evaluates (at compile-time) exactly to the specified type.
+This macro expands to an expression that evaluates (at compile-time) exactly to the specified type (furthermore, this macro does not use variadic macros so it works on any __CXX03__ compiler).
 Note that a total of two set of parenthesis `()` are needed: The parenthesis to invoke the `BOOST_IDENTITY_TYPE(...)` macro plus the parenthesis to wrap the type expression (and therefore any comma `,` that it contains) passed as parameter to the `BOOST_IDENTITY_TYPE((...))` macro.
 Finally, the `BOOST_IDENTITY_TYPE` macro must be prefixed by the `typename` keyword `typename BOOST_IDENTITY_TYPE(`[^['parenthesized-type]]`)` when used together with the [macroref BOOST_LOCAL_FUNCTION_TPL] macro within templates.
 
@@ -102,7 +103,7 @@
     ) BOOST_LOCAL_FUNCTION_NAME(f)
 
 [*(2)] The parameter type `::sign_t` starts with the non-alphanumeric symbols `::` thus it will generate preprocessor errors if used as a local function parameter type.
-The macros `BOOST_IDENTITY_TYPE` can also be used to overcome this issue:
+The `BOOST_IDENTITY_TYPE` macro can also be used to overcome this issue:
 
     void BOOST_LOCAL_FUNCTION(
         ...
@@ -128,7 +129,7 @@
 
 [*(3)] The default parameter value `key_sizeof<std::string, size_t>::value` contains a comma `,` after the first template parameter `std::string`.
 Again, this comma is not wrapped by any parenthesis `()` so it will cause a preprocessor error.
-Because this is a value expression (and not a type expression), it can be simply wrapped within an extra set of round parenthesis `()`:
+Because this is a value expression (and not a type expression), it can simply be wrapped within an extra set of round parenthesis `()`:
 
     void BOOST_LOCAL_FUNCTION(
         ...
@@ -147,22 +148,21 @@
 
 [endsect]
 
-[section Assigning and Returning]
+[section Assignments and Returns]
 
-Local functions are function objects so it is possible to assign them to other functors like __Boost_Function__ `boost::function` in order to store the local function into a variable, pass it as a parameter to another function, or return it from the enclosing function.
+Local functions are function objects so it is possible to assign them to other functors like __Boost_Function__'s `boost::function` in order to store the local function into a variable, pass it as a parameter to another function, or return it from the enclosing function.
 
 For example (see also [@../../test/return_assign.cpp =return_assign.cpp=]):
 
 [return_assign]
 
-Note that:
-
-[important
-As with __CPP11_lambda__ functions, programmers are responsible to ensure that bound references are valid in any scope where the local function object is called.
-(This might be tricky to verify in a program when local functions are returned and called outside the local scope of their declaration.)
+[warning
+As with __CXX11_lambda_functions__, programmers are responsible to ensure that bound variables are valid in any scope where the local function object is called.
+Returning and calling a local function outside its declaration scope will lead to undefined behaviour if any of the bound variable is no longer valid in the scope where the local function is called (see the __Examples__ section for more examples on the extra care needed when returning a local function as a closure).
+It is always safe instead to call a local function within its enclosing scope.
 ]
 
-In addition, a local function can bind and call another local function.
+In addition, a local function can bind and call other local functions.
 Local functions should always be bound by constant reference `const bind&` to avoid unnecessary copies.
 For example, the following local function `inc_sum` binds the local function `inc` so `inc_sum` can call `inc` (see aslo [@../../test/transform.cpp =transform.cpp=]):
 
@@ -181,7 +181,7 @@
 
 [section Accessing Types (concepts, etc)]
 
-This library never requires to explicitly specify the type of bound variables.
+This library never requires to explicitly specify the type of bound variables (e.g., this reduces maintenance because the local function declaration and definition do not have to change even if the bound variable types change as long as the semantics of the local function remain valid).
 From within local functions, programmers can access the type of a bound variable using the following macro:
 
     BOOST_LOCAL_FUNCTION_TYPEOF(``/bound-variable-name/``)
@@ -198,10 +198,7 @@
 
 [typeof_template]
 
-It is best to use the [macroref BOOST_LOCAL_FUNCTION_TYPEOF] macro instead of using __Boost_Typeof__ so to reduce the number of times that __Boost_Typeof__ is invoked:
-
-# Either the library already internally used __Boost_Typeof__ once, in which case using this macro will not use __Boost_Typeof__ again.
-# Or, the bound variable type is explicitly specified by programmers (see below), in which case using this macro will not use __Boost_Typeof__ at all.
+In this context, it is best to use the [macroref BOOST_LOCAL_FUNCTION_TYPEOF] macro instead of using __Boost_Typeof__ to reduce the number of times that __Boost_Typeof__ is invoked (either the library already internally used __Boost_Typeof__ once, in which case using this macro will not use __Boost_Typeof__ again, or the bound variable type is explicitly specified by programmers as shown be below, in which case using this macro will not use __Boost_Typeof__ at all).
 
 Furthermore, within the local function body it possible to access the result type using `result_type`, the type of the first parameter using `arg1_type`, the type of the second parameter using `arg2_type`, etc.
 [footnote
@@ -211,9 +208,9 @@
 
 [endsect]
 
-[section Specifying Types]
+[section Specifying Types (no Boost.Typeof)]
 
-While not required, it is possible to explicitly specify the type of a bound variable so the library will not internally use __Boost_Typeof__ to automatically deduce such a type.
+While not required, it is possible to explicitly specify the type of bound variables so the library will not internally use __Boost_Typeof__ to automatically deduce the types.
 When specified, the bound variable type must follow the `bind` "keyword" and it must be wrapped within round parenthesis `()`:
 
     bind(``/variable-type/``) ``/variable-name/`` // Bind by value with explicit type.
@@ -231,29 +228,28 @@
     BOOST_LOCAL_FUNCTION_TYPE(return ``[^/result-type/]``, ...)
 
 Note that the result type must be specified only once either before the macro (without the `return` prefix) or as one of the macro parameters (with the `return` prefix).
-As usual, the result type can always be `void` to declare a function returning nothing (so `return void` is allowed when the result type is specified as one of the macro parameters).
+As always, the result type can be `void` to declare a function that returns nothing (so `return void` is allowed when the result type is specified as one of the macro parameters).
 
 The following example specifies all bound variables and result types (see also [@../../test/add_typed.cpp =add_typed.cpp=]):
 [footnote
-In the examples of this documentation, we specify bound variables, function parameters, and result type in this order because this is the order used by __CPP11_lambda__ functions.
+In the examples of this documentation, bound variables, function parameters, and the result type are specified in this order because this is the order used by __CXX11_lambda_functions__.
 However, the library accepts bound variables, function parameters, and the result type in any order.
 ]
 
 [add_typed]
 
 Unless necessary, it is recommended to not specify the bound variable and result types.
-Let the library deduce these types so the local function syntax will be more concise and the local function declaration will not have to change if a bound variable type changes (facilitating maintenance).
+Let the library deduce these types so the local function syntax will be more concise and the local function declaration will not have to change if a bound variable type changes (reducing maintenance).
 
 [note
-Unfortunately, even when all bound variables and result types are explicitly specified, the currently library implementation still has to use __Boost_Typeof__ once (to deduce the local function object type, see the __Implementation__ section).
+When all bound variable and result types are explicitly specified, the library implementation will not use __Boost_Typeof__.
 ]
 
-
 [endsect]
 
 [section Inlining]
 
-Local functions can be declared inline to increase the chances that the compiler will be able to reduce the run-time of the local function call by inlining the generated assembly code.
+Local functions can be declared [@http://en.wikipedia.org/wiki/Inline_function inline] to increase the chances that the compiler will be able to reduce the run-time of the local function call by inlining the generated assembly code.
 A local function is declared inline by prefixing its name with the keyword `inline`:
 
     ``/result-type/`` BOOST_LOCAL_FUNCTION(``/parameters/``) {
@@ -262,20 +258,20 @@
 
 When inlining a local function, note the following:
 
-* On __CPP03__ compliant compilers, inlined local functions always have a run-time comparable to their equivalent implementation that uses local functors (see the __Alternatives__ section).
-However, inlined local functions have the important limitation that they cannot be assigned to other functors (like `boost::function`) and they cannot be passed as template parameters.
-* On __CPP11__ compilers, `inline` has no effect because this library will automatically generate code that uses __CPP11__ specific features to inline the local function calls whenever possible even if the local function is not declared inline.
-Furthermore, non __CPP11__ local functions can always be passes as template parameters even when they are declared inline.
+* On __CXX03__ compliant compilers, inline local functions always have a run-time comparable to their equivalent implementation that uses local functors (see the __Alternatives__ section).
+However, inline local functions have the important limitation that they cannot be assigned to other functors (like `boost::function`) and they cannot be passed as template parameters.
+* On __CXX11__ compilers, `inline` has no effect because this library will automatically generate code that uses __CXX11__ specific features to inline the local function calls whenever possible even if the local function is not declared inline.
+Furthermore, non __CXX11__ local functions can always be passes as template parameters even when they are declared inline.
 [footnote
 *Rationale.*
 This library uses an indirect function call via a function pointer in order to pass the local function as a template parameter (see the __Implementation__ section).
 No compiler has yet been observed to be able to inline function calls when they use such indirect function pointer calls.
-Therefore, inlined local functions do not use such indirect function pointer call (so they are more likely to be optimized) but because of that they cannot be passed as template parameters.
-The indirect function pointer call is needed on __CPP03__ but it is not needed on __CPP11__ (see __N2657__) thus this library automatically generates local function calls that can be inlined on __CPP11__ compilers (even when the local function is not declared inline).
+Therefore, inline local functions do not use such indirect function pointer call (so they are more likely to be optimized) but because of that they cannot be passed as template parameters.
+The indirect function pointer call is needed on __CXX03__ but it is not needed on __CXX11__ (see __N2657__ and __Boost_Config__'s `BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS`) thus this library automatically generates local function calls that can be inline on __CXX11__ compilers (even when the local function is not declared inline).
 ]
 
 [important
-It is recommended to not declare a local function inline unless it is strictly necessary for optimizing pure __CPP03__ compliant code (because in all other cases this library will automatically take advantage of __CPP11__ features to optimize the local function calls while always allowing to pass the local function as a template parameter).
+It is recommended to not declare a local function inline unless it is strictly necessary for optimizing pure __CXX03__ compliant code (because in all other cases this library will automatically take advantage of __CXX11__ features to optimize the local function calls while always allowing to pass the local function as a template parameter).
 ]
 
 For example, the following local function is declared inline (thus a for-loop needs to be used for portability instead of passing the local function as a template parameter to the `std::for_each` algorithm, see also [@../../test/add_inline.cpp =add_inline.cpp=]):
@@ -287,7 +283,7 @@
 [section Recursion]
 
 Local functions can be declared [@http://en.wikipedia.org/wiki/Recursion_(computer_science)#Recursive_procedures recursive] so a local function can recursively call itself from its body (as usual with C++ functions).
-A local function is declared recursive by prefixing its name with the "keyword" `recursive` (thus `recursive` cannot be used as a local function name):
+A local function is declared recursive by prefixing its name with the `recursive` "keyword" (thus `recursive` cannot be used as a local function name):
 
     ``/result-type/`` BOOST_LOCAL_FUNCTION(``/parameters/``) {
         ... // Body.
@@ -297,27 +293,32 @@
 
 [factorial]
 
-Compilers have not been observed to be able to inline recursive local function calls (not even when the recursive local function is also declared inline as in `BOOST_LOCAL_FUNCTION_NAME(inline recursive factorial)`).
+Compilers have not been observed to be able to inline recursive local function calls not even when the recursive local function is also declared inline:
+
+ ... BOOST_LOCAL_FUNCTION_NAME(inline recursive factorial)
 
-[warning
 Recursive local functions should never be called outside their declaration scope.
-If a local function is returned from the enclosing function and called in a different scope, the behaviour is undefined (and it will likely result in a run-time error).
 [footnote
 *Rationale.*
 This limitation comes from the fact that the global functor used to pass the local function as a template parameter (and eventually returned outside the declarations scope) does not know the local function name so the local function name used for recursive call cannot be set in the global functor.
 This limitation together with preventing the possibility for inlining are the reasons why local functions are not recursive unless programmers explicitly declare them `recursive`.
 ]
-This is not a limitation with respect to __CPP11_lambda__ functions because lambdas can never call themselves recursively (in other words, there is no recursive lambda function that can successfully be called outside its declaration scope because there is no recursive lambda function at all).
+
+[warning
+If a local function is returned from the enclosing function and called in a different scope, the behaviour is undefined (and it will likely result in a run-time error).
 ]
 
+This is not a limitation with respect to __CXX11_lambda_functions__ because lambdas can never call themselves recursively (in other words, there is no recursive lambda function that can successfully be called outside its declaration scope because there is no recursive lambda function at all).
+
 [endsect]
 
 [section Overloading]
 
-It is possible to overload local functions using the `boost::overloaded_function` functor of __Boost_Functional_OverloadedFunction__ from the header =boost/functional/overloaded_function.hpp= (see the __Boost_Functional_OverloadedFunction__ documentation for details).
+Because local functions are functors, it is possible to overload them using the `boost::overloaded_function` functor of __Boost_Functional_OverloadedFunction__ from the =boost/functional/overloaded_function.hpp= header (see the __Boost_Functional_OverloadedFunction__ documentation for details).
 
 In the following example, the overloaded function object `add` can be called with signatures from either the local function `add_s`, or the local function `add_d`, or the local function `add_d` with its extra default parameter, or the function pointer `add_i` (see also [@../../test/overload.cpp =overload.cpp=]):
 
+[overload_decl]
 [overload]
 
 [endsect]
@@ -337,14 +338,14 @@
 
 [endsect]
 
-[section Storage Classifiers (`auto` and `register`)]
+[section Storage Classifiers]
 
-Local function parameters support the storage classifiers as usual in __CPP03__.
+Local function parameters support the storage classifiers as usual in __CXX03__.
 The `auto` storage classifier is specified as:
 [footnote
-The `auto` storage classifier is part of the __CPP03__ standard and therefore supported by this library.
-However, the meaning and usage of the `auto` keyword changed in __CPP11__.
-Therefore, use the `auto` storage classifier with the usual care in order to avoid writing __CPP03__ code that might not work on __CPP11__.
+The `auto` storage classifier is part of the __CXX03__ standard and therefore supported by this library.
+However, the meaning and usage of the `auto` keyword changed in __CXX11__.
+Therefore, use the `auto` storage classifier with the usual care in order to avoid writing __CXX03__ code that might not work on __CXX11__.
 ]
 
         auto ``/parameter-type parameter-name/``
@@ -359,6 +360,32 @@
 
 [endsect]
 
+[section Same Line Expansions]
+
+In general, it is not possible to expand the [macroref BOOST_LOCAL_FUNCTION], [macroref BOOST_LOCAL_FUNCTION_TPL] macros multiple times on the same line.
+[footnote
+*Rationale.*
+The [macroref BOOST_LOCAL_FUNCTION] and [macroref BOOST_LOCAL_FUNCTION_TPL] macros internally use `__LINE__` to generate unique identifiers.
+Therefore, if these macros are expanded more than on time on the same line, the generated identifiers will no longer be unique and the code will not compile.
+(This restriction does not apply to MSVC and other compilers that provide the non-standard `__COUNTER__` macro.)
+Note that the [macroref BOOST_LOCAL_FUNCTION_NAME] macro can always be expanded multiple times on the same line because the unique local function name (and not `__LINE__`) is used by this macro to generate unique identifiers (so there is no need for a `BOOST_LOCAL_FUNCTION_NAME_ID` macro).
+]
+
+Therefore, this library provides additional macros [macroref BOOST_LOCAL_FUNCTION_ID] and [macroref BOOST_LOCAL_FUNCTION_ID_TPL] which can be expanded multiple times on the same line as long as programmers specify unique identifiers as the macros' first parameters.
+The unique identifier can be any token (not just numeric) that can be successfully concatenated by the preprocessor (e.g., `local_function_number_1_at_line_123`).
+[footnote
+Because there are restrictions on the set of tokens that the preprocessor can concatenate and because not all compilers correctly implement these restrictions, it is in general recommended to specify unique identifiers as a combination of alphanumeric tokens.
+]
+
+The [macroref BOOST_LOCAL_FUNCTION_ID] and [macroref BOOST_LOCAL_FUNCTION_ID_TPL] macros accept local function parameter declaration lists using the exact same syntax as [macroref BOOST_LOCAL_FUNCTION].
+For example (see also [@../../test/same_line.cpp =same_line.cpp=]):
+
+[same_line]
+
+As shown by the example above, the [macroref BOOST_LOCAL_FUNCTION_ID] and [macroref BOOST_LOCAL_FUNCTION_ID_TPL] macros are especially useful when it is necessary to invoke them multiple times within a user-defined macro (because the preprocessor expands all nested macros on the same line).
+
+[endsect]
+
 [section Limitations (operators, etc)]
 
 The following table summarizes all C++ function features indicating those features that are not supported by this library for local functions.
@@ -371,73 +398,73 @@
 ]
 [
     [ `export` ]
- [ No ]
+ [ No. ]
     [ This is not supported because local functions cannot be templates (plus most C++ compilers do not implement `export` at all). ]
 ]
 [
     [ `template<`[^['template-parameter-list]]`>` ]
- [ No ]
- [ This is not supported because local functions are implemented using local classes and __CPP03__ local classes cannot be templates. ]
+ [ No. ]
+ [ This is not supported because local functions are implemented using local classes and __CXX03__ local classes cannot be templates. ]
 ]
 [
     [ `explicit` ]
- [ No ]
+ [ No. ]
     [ This is not supported because local functions are not constructors. ]
 ]
 [
     [ `inline` ]
- [ Yes ]
- [ Local functions can be specified `inline` to improve the chances that __CPP03__ standard compilers can optimize the local function call run-time (but `inline` local functions cannot be passed as template parameters on __CPP03__ standard compilers, see the __Advanced_Topics__ section). ]
+ [ Yes. ]
+ [ Local functions can be specified `inline` to improve the chances that __CXX03__ compilers can optimize the local function call run-time (but `inline` local functions cannot be passed as template parameters on __CXX03__ compilers, see the __Advanced_Topics__ section). ]
 ]
 [
     [ `extern` ]
- [ No ]
+ [ No. ]
     [ This is not supported because local functions are always defined locally within the enclosing scope and together with their declarations. ]
 ]
 [
     [ `static` ]
- [ No ]
+ [ No. ]
     [ This is not supported because local functions are not member functions. ]
 ]
 [
     [ `virtual` ]
- [ No ]
+ [ No. ]
     [ This is not supported because local functions are not member functions.
 [footnote
 *Rationale.*
 It would be possible to make a local function class inherit from another local function class.
-However, this "inheritance" feature is not implemented because it seemed of [@http://lists.boost.org/Archives/boost/2010/09/170895.php no use] given that local functions can be bound to one another thus they can simply call each other directly without recurring to dynamic binding or base function call.
+However, this "inheritance" feature is not implemented because it seemed of [@http://lists.boost.org/Archives/boost/2010/09/170895.php no use] given that local functions can be bound to one another thus they can simply call each other directly without recurring to dynamic binding or base function calls.
 ]
     ]
 ]
 [
     [ [^/result-type/] ]
- [ Yes ]
+ [ Yes. ]
     [ This is supported (see the __Tutorial__ section). ]
 ]
 [
     [ [^/function-name/] ]
- [ Yes ]
+ [ Yes. ]
     [ Local functions are named and they can call themselves recursively but they cannot be operators (see the __Tutorial__ and __Advanced_Topics__ sections). ]
 ]
 [
     [ [^/parameter-list/] ]
- [ Yes ]
+ [ Yes. ]
     [ This is supported and it also supports the `auto` and `register` storage classifiers, default parameters, and binding of variables in scope (see the __Tutorial__ and __Advanced_Topics__ sections). ]
 ]
 [
     [ Trailing `const` qualifier ]
- [ No ]
+ [ No. ]
     [ This is not supported because local functions are not member functions. ]
 ]
 [
     [ Trailing `volatile` qualifier ]
- [ No ]
+ [ No. ]
     [ This is not supported because local functions are not member functions. ]
 ]
 ]
 
-[h5 Operators]
+[heading Operators]
 
 Local functions cannot be operators.
 Naming a local function `operator...` will generate a compile-time error.
@@ -446,17 +473,21 @@
 This is the because a local function name must be a valid local variable name (the local variable used to hold the local functor) and operators cannot be used as local variable names.
 ]
 
-For example, the following code will not compile:
+For example, the following code does not compile (see also [@../../test/operator_error.cpp =operator_error.cpp=]):
+
+[operator_error]
 
-[operator_err]
+[heading Goto]
 
-[h5 Goto]
+It is possible to jump with a `goto` within the local function body.
+For example, the following compiles (see also [@../../test/goto.cpp =goto.cpp=]):
 
-It is not possible to jump with a `goto` from within a local function to a label defined in the enclosing scope.
+[goto]
 
-For example, the following will not compile:
+However, it is not possible to jump with a `goto` from within the local function body to to a label defined in the enclosing scope.
+For example, the following does not compile (see also [@../../test/goto_error.cpp =goto_error.cpp=]):
 
-[goto_err]
+[goto_error]
 
 [endsect]
 

Modified: branches/release/libs/local_function/doc/alternatives.qbk
==============================================================================
--- /trunk/libs/local_function/doc/alternatives.qbk (original)
+++ branches/release/libs/local_function/doc/alternatives.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,11 +5,11 @@
 [/ http://www.boost.org/LICENSE_1_0.txt) ]
 [/ Home at http://www.boost.org/libs/local_function ]
 
-[section:Alternatives Annex: Alternatives]
+[section:alternatives Annex: Alternatives]
 
 This section compares the features offered by this library with similar features offered by C++ and by other libraries.
 
-[h5 Features]
+[heading Features]
 
 The following table compares local function features.
 
@@ -34,13 +34,13 @@
 [
     [ ['Can be defined using C++ statement syntax] ]
     [ Yes.
-Plus eventual compiler errors and debugging follow the usual format of C++ statement errors. ]
+Plus eventual compiler errors and debugging retain their usual meaning and format. ]
     [ Yes.
-Plus eventual compiler errors and debugging follow the usual format of C++ statement errors. ]
+Plus eventual compiler errors and debugging retain their usual meaning and format. ]
     [ Yes.
-Plus eventual compiler errors and debugging follow the usual format of C++ statement errors. ]
+Plus eventual compiler errors and debugging retain their usual meaning and format. ]
     [ Yes.
-Plus eventual compiler errors and debugging follow the usual format of C++ statement errors. ]
+Plus eventual compiler errors and debugging retain their usual meaning and format. ]
     [ No (it uses C++ __expression_template__ syntax). ]
 ]
 [
@@ -54,19 +54,19 @@
 [
     [ ['Can be passed as template parameter (e.g., to STL algorithms)] ]
     [ Yes.
-The __CPP03__ standard does not allow to pass local types as template parameters (see __N2657__) but this library implements a "trick" to get around this limitation (see the __Implementation__ section). ]
+The __CXX03__ standard does not allow to pass local types as template parameters (see __N2657__) but this library implements a "trick" to get around this limitation (see the __Implementation__ section). ]
     [ Yes. ]
- [ No on __CPP03__ compilers (but yes on __CPP11__ compilers and some compilers like MSVC 8.0, see __N2657__). ]
+ [ No on __CXX03__ compilers (but yes on __CXX11__ compilers and some compilers like MSVC 8.0, see __N2657__). ]
     [ Yes. ]
     [ Yes. ]
 ]
 [
     [ ['Access variables in scope] ]
     [ Yes.
-The variable names are repeated in the function declaration so they can be bound by value, by constant value, by reference, and by constant reference (the object `this` can also be bound). ]
+The variable names are repeated in the function declaration so they can be bound by value, by constant value, by reference, and by constant reference (the object `this` can also be bound using `this_`). ]
     [ Yes.
 The variable names are repeated in the function declaration (plus there is a short-hand syntax to bind all variables in scope at once) so they can be bound by constant value and by reference (the object `this` can also be bound).
-However, variables cannot be bound by constant references and non-constant value (see below). ]
+However, variables cannot be bound by constant references (see below). ]
     [ No.
 Programmers must manually program functor data members and explicitly specify their types to access variables in scope. ]
     [ No.
@@ -75,9 +75,9 @@
 Variables in scope are accessible as usual within expressions (plus `boost::phoenix::let` can be used to bind variables by constant reference). ]
 ]
 [
- [ ['[@http://en.wikipedia.org/wiki/Type_polymorphism#Parametric_polymorphism Polymorphic] in the unbound parameter types] ]
+ [ ['[@http://en.wikipedia.org/wiki/Type_polymorphism#Parametric_polymorphism Polymorphic] in the function parameter type] ]
     [ No (local functions cannot be function templates). ]
- [ No (__CPP11__ lambdas cannot be function templates). ]
+ [ No (__CXX11__ lambdas cannot be function templates). ]
     [ No (local classes cannot have member function templates). ]
     [ Yes. ]
     [ Yes. ]
@@ -86,32 +86,32 @@
 
 [*C++11 Lambda Function]
 
-__CPP11_lambda__ functions have most of the features of this library (see also the example in the __Introduction__ section):
+__CXX11_lambda_functions__ have most of the features of this library plus some additional feature (see also the example in the __Introduction__ section):
 
-* __CPP11_lambda__ functions can be defined within expressions while this library local functions can only be defined at declaration scope.
-* __CPP11_lambda__ functions are only supported by the __CPP11__ standard so they are not supported by all C++ compilers.
-This library local functions can be programmed also on __CPP03__ compilers (and they have performances comparable to __CPP11_lambda__ functions on __CPP11__ compilers).
-* __CPP11_lambda__ functions do not allow to bind variables in scope by constant reference or by non-constant value.
-Because a variable cannot be bound by constant reference, __CPP11_lambda__ functions can bind a variable by constant only if the variable is `CopyConstructible` and the binding requires a (potentially expensive) extra copy operation.
-Both constant reference and non-constant value binding are instead supported by this library.
-However, __CPP11_lambda__ functions provide a short-hand syntax to bind all variables in scope at once (`&` or `=`).
+* __CXX11_lambda_functions__ can be defined within expressions while this library local functions can only be defined at declaration scope.
+* __CXX11_lambda_functions__ are only supported by the __CXX11__ standard so they are not supported by all C++ compilers.
+This library local functions can be programmed also on __CXX03__ compilers (and they have performances comparable to __CXX11_lambda_functions__ on __CXX11__ compilers).
+* __CXX11_lambda_functions__ do not allow to bind variables in scope by constant reference.
+Because a variable cannot be bound by constant reference, __CXX11_lambda_functions__ can bind a variable by constant only if the variable is `CopyConstructible` and the binding requires a (potentially expensive) extra copy operation.
+Constant reference binding is instead supported by this library.
+* __CXX11_lambda_functions__ do not allow to bind data members selectively without binding also the object `this` while this library local functions can bind either selected data members or the entire object `this` (using `this_`).
+* __CXX11_lambda_functions__ provide a short-hand syntax to bind all variables in scope at once (`&` or `=`) while this library local function always require to bind variables naming them one-by-one.
 
-For example, for non-copyable objects (see also [@../../example/noncopyable_lambda_err.cpp =noncopyable_lambda_err.cpp=] and [@../../example/noncopyable_local_function.cpp =noncopyable_local_function.cpp=]):
+For example, for non-copyable objects (see also [@../../example/noncopyable_cxx11_lambda_error.cpp =noncopyable_cxx11_lambda_error.cpp=] and [@../../example/noncopyable_local_function.cpp =noncopyable_local_function.cpp=]):
 
 [table
- [ [C++11 Lambda] [Boost.LocalFunction] ]
- [ [[noncopyable_lambda_err]] [[noncopyable_local_function]] ]
+ [ [C++11 Lambda Function] [Boost.LocalFunction] ]
+ [ [[noncopyable_cxx11_lambda_error]] [[noncopyable_local_function]] ]
 ]
 
-Or, for objects with expensive copy operations (see also [@../../example/expensive_copy_lambda.cpp =expensive_copy_lambda.cpp=] and [@../../example/expensive_copy_local_function.cpp =expensive_copy_local_function.cpp=]):
+Or, for objects with expensive copy operations (see also [@../../example/expensive_copy_cxx11_lambda.cpp =expensive_copy_cxx11_lambda.cpp=] and [@../../example/expensive_copy_local_function.cpp =expensive_copy_local_function.cpp=]):
 
 [table
- [ [C++11 Lambda] [Boost.LocalFunction] ]
- [ [[expensive_copy_lambda]] [[expensive_copy_local_function]] ]
+ [ [C++11 Lambda Function] [Boost.LocalFunction] ]
+ [ [[expensive_copy_cxx11_lambda]] [[expensive_copy_local_function]] ]
 ]
 
-When constant binding functionality is needed for __CPP11_lambda__ functions, the best alternative might be to bind an extra local variable declared constant and initialized to the original variable (for example, `const n& const_x = x` and then bind `const_x` instead of `x` to the lambda function).
-In many cases the use of the extra constant variable `const_x` can be acceptable but in other cases (e.g., /constant blocks/ presented in the __Examples__ section) it might be preferable to maintain the same variable name `x` within the function body.
+When constant binding functionality is needed for __CXX11_lambda_functions__, the best alternative might be to bind an extra local variable declared constant and initialized to the original variable (for example, see /constant blocks/ implemented with __CXX11_lambda_functions__ in the __Examples__ section).
 
 [*Local Functor]
 
@@ -145,29 +145,29 @@
 The comparison in this section does not include the __Boost_Lambda__ library because that library is obsolete and it was replaced by __Boost_Phoenix__.
 The __Boost_Phoenix__ library version 3.0 is used for this comparison.
 
-[h5 Performances]
+[heading Performances]
 
-The following tables compare run-times, compile-times, and binary sizes for the different alternatives presented here for local functions.
+The following tables compare run-times, compile-times, and binary sizes for the different alternatives to local functions presented in this section.
 
 Overall, this library has compile-times and generates binary sizes similar to the ones of the other approaches.
-This library run-times on __CPP03__ compilers were measured to be larger than other approaches when compiler optimization is enabled (using `bjam release ...`).
-However, on compilers that allow to pass local types as template parameters (e.g., MSVC 8.0 or GCC 4.5.3 with __CPP11__ features enabled [^-std=c++0x], see also __N2657__) this library automatically generates optimized code that runs as fast as the fastest of the other approaches (see the "Boost.LocalFunction" approach below).
+This library run-times on __CXX03__ compilers were measured to be larger than other approaches when compiler optimization is enabled (using `bjam release ...`).
+However, on compilers that allow to pass local types as template parameters (e.g., MSVC 8.0 or GCC 4.5.3 with __CXX11__ features enabled [^-std=c++0x], see also __N2657__ and __Boost_Config__'s `BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS`) this library automatically generates optimized code that runs as fast as the fastest of the other approaches (see the "Boost.LocalFunction" approach below).
 When this library local function is specified `inline` (see the "Boost.LocalFunction Inline" approach below and the __Advanced_Topics__ section) its run-times are always comparable to both the "Local Functor" and "Global Functor" approaches.
-However, in these cases the local function cannot be portably passed as template parameter (see __N2657__) so `std::for_each` is replaced by a for-loop (on MSVC the for-loop, and not the local function in fact the same applies to local functors, was measured to have worst performances than using `std::for_each`).
+However, in these cases the local function cannot be portably passed as template parameter (see __N2657__ and __Boost_Config__'s `BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS`) so `std::for_each` is replaced by a for-loop (on MSVC the for-loop, and not the local function in fact the same applies to local functors, was measured to have worst performances than using `std::for_each`).
 Finally, this library run-times are always among the fastest when no compiler optimization is enabled (using `bjam debug ...`).
 
 [note
-The run-time performances of this library local functions are explained because on __CPP03__ compliant compilers (e.g., GCC 4.5.3 without [^-std=c++0x]) this library needs to use a function pointer in order to pass the local function class as a template parameter (see __N2657__ and the __Implementation__ section).
+The run-time performances of this library local functions are explained because on __CXX03__ compliant compilers (e.g., GCC 4.5.3 without [^-std=c++0x]) this library needs to use a function pointer in order to portably pass the local function class as a template parameter (see __N2657__ and the __Implementation__ section).
 For all tested compilers, this function pointer prevents the compiler optimization algorithms from inlining the local function calls.
 Instead, the functors used by other approaches (e.g., __Boost_Phoenix__) have been observed to allow all tested compilers to inline all the function calls for optimization.
-This run-time performance cost is not present on compilers that allow to pass local types as template parameters (e.g., MSVC 8.0 or GCC 4.5.3 with __CPP11__ features enabled [^-std=c++0x]) because this library does not have to use the extra function pointer to implement the local function call (it directly passes the local class type as template parameter).
+This run-time performance cost is not present on compilers that allow to pass local types as template parameters (e.g., MSVC 8.0 or GCC 4.5.3 with __CXX11__ features enabled [^-std=c++0x], see __Boost_Config__'s `BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS`) because this library does not have to use the extra function pointer to implement the local function call (it directly passes the local class type as template parameter).
 ]
 
-This run-time performance cost on __CPP03__ compilers might or might not be an issue depending on the performance requirements of specific applications.
+This run-time performance cost on __CXX03__ compilers might or might not be an issue depending on the performance requirements of specific applications.
 For example, an application might already be using a number of indirect function calls (function pointers, virtual functions, etc) for which the overhead added by using the one extra function pointer required by the local function call might not be noticeable within the overall program run-time.
 
 Finally, note that only a very simple local function body with just a single instruction was used for the anaylsis presented here (see the source files below).
-The authors have not studied how this library and the other approaches will perform with respect to each other when a more complex set of instructions is programmed for the local function body (e.g., /if/ a more complex set of instructions in the local function body were to inhibit some compilers from inlining functor objects also other approaches like __Boost_Phoenix__ /could/ start to show higher run-times even when optimization is enabled).
+The authors have not studied how this library and the other approaches will perform with respect to each other when a more complex set of instructions is programmed for the local function body (e.g., /if/ a more complex set of instructions in the local function body were to inhibit some compiler from inlining function objects also other approaches like __CXX11_lambda_functions__ and __Boost_Phoenix__ /could/ start to show higher run-times even when optimization is enabled).
 
 The following commands were executed from the library example directory to measure compile-time, binary size, and run-time respectively:
 
@@ -197,13 +197,13 @@
         [[@../../example/profile_local_function_inline.cpp =profile_local_function_inline.cpp=]]
     ]
     [
- [[$../../example/profile_legend_lambda.png]]
- [__CPP11__ Lambda Function
+ [[$../../example/profile_legend_cxx11_lambda.png]]
+ [__CXX11__ Lambda Function
 [footnote
-Measurements available only for __CPP11__ compilers.
+Measurements available only for __CXX11__ compilers.
 ]
         ]
- [[@../../example/profile_lambda.cpp =profile_lambda.cpp=]]
+ [[@../../example/profile_cxx11_lambda.cpp =profile_cxx11_lambda.cpp=]]
     ]
     [
         [[$../../example/profile_legend_local_functor.png]]
@@ -223,19 +223,19 @@
 ]
 
 [table
- [ [GCC 4.5.3 With C++11 Lambdas and "Local Types as Template Parameters" ([^bjam cxxflags=-std=c++0x ...])] ]
+ [ [GCC 4.5.3 With C++11 Lambda Functions and "Local Classes as Template Parameters" ([^bjam cxxflags=-std=c++0x ...])] ]
     [ [
         [*Compiled with =bjam release ...= for maximum optimization (=-O3 -finline-functions=)]
- [$../../example/profile_gcc_cpp11_release.png [width 13in] [height 10in]]
+ [$../../example/profile_gcc_cxx11_release.png [width 13in] [height 10in]]
     ] ]
     [ [
         [*Compiled with =bjam debug ...= for no optimization (=-O0 -fno-inline=)]
- [$../../example/profile_gcc_cpp11_debug.png [width 13in] [height 10in]]
+ [$../../example/profile_gcc_cxx11_debug.png [width 13in] [height 10in]]
     ] ]
 ]
 
 [table
- [ [MSVC 8.0 With "Local Types as Template Parameters" (Without __CPP11__ Lambdas)] ]
+ [ [MSVC 8.0 With "Local Classes as Template Parameters" (Without C++11 Lambda Functions)] ]
     [ [
         [*Compiled with =bjam release ...= for maximum optimization (=/O2 /Ob2=)]
         [$../../example/profile_msvc_release.png [width 13in] [height 10in]]
@@ -247,7 +247,7 @@
 ]
 
 [table
- [ [GCC 4.3.4 With __CPP03__ Only (Without __CPP11__ Lambdas and Without "Local Types as Template Parameters")] ]
+ [ [GCC 4.3.4 With __CXX03__ Only (Without __CXX11__ Lambda Functions and Without "Local Classes as Template Parameters")] ]
     [ [
         [*Compiled with =bjam release ...= for maximum optimization (=-O3 -finline-functions=)]
         [$../../example/profile_gcc_release.png [width 13in] [height 10in]]

Modified: branches/release/libs/local_function/doc/bibliography.qbk
==============================================================================
--- /trunk/libs/local_function/doc/bibliography.qbk (original)
+++ branches/release/libs/local_function/doc/bibliography.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,7 +5,7 @@
 [/ http://www.boost.org/LICENSE_1_0.txt) ]
 [/ Home at http://www.boost.org/libs/local_function ]
 
-[section:Bibliography Bibliography]
+[section Bibliography]
 
 This section lists all the bibliographic references cited by this documentation.
 

Modified: branches/release/libs/local_function/doc/examples.qbk
==============================================================================
--- /trunk/libs/local_function/doc/examples.qbk (original)
+++ branches/release/libs/local_function/doc/examples.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,32 +5,36 @@
 [/ http://www.boost.org/LICENSE_1_0.txt) ]
 [/ Home at http://www.boost.org/libs/local_function ]
 
-[section:Examples Examples]
+[section Examples]
 
 This section lists some examples that use this library.
 
-[section GCC Lambdas (Without C++11)]
+[section GCC Lambdas (without C++11)]
 
-Combing local functions with the [@http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html statement expression] extension of GCC compilers, it is possible to implement lambda functions for GCC compilers even without __CPP11__ support.
+Combing local functions with the non-standard [@http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html statement expression] extension of the GCC compiler, it is possible to implement lambda functions for GCC compilers even without __CXX11__ support.
 
 [warning
-This code only works on compilers that support the statement expression GCC extension or that support __CPP11_lambda__ functions.
+This code only works on compilers that support GCC statement expression extension or that support __CXX11_lambda_functions__.
 ]
 
-For example (see also [@../../example/gcc_lambda.cpp =gcc_lambda.cpp=] and [@../../example/gcc_lambda_cpp11.cpp =gcc_lambda_cpp11.cpp=]):
+For example (see also [@../../example/gcc_lambda.cpp =gcc_lambda.cpp=] and [@../../example/gcc_cxx11_lambda.cpp =gcc_cxx11_lambda.cpp=]):
 
 [table
     [ [With Local Functions (GCC only)] [C++11 Lambdas] ]
- [ [[gcc_lambda]] [[gcc_lambda_cpp11]] ]
+ [ [[gcc_lambda]] [[gcc_cxx11_lambda]] ]
 ]
 
-Where the macros are defined in [@../../example/gcc_lambda.hpp =gcc_lambda.hpp=].
+The GCC lambda function macros are implemented using local functions (see also [@../../example/gcc_lambda.hpp =gcc_lambda.hpp=]):
+
+[gcc_lambda_macro]
+[gcc_lambda_end_macro]
 
 This is possible because GCC statement expressions allow to use declaration statements within expressions and therefore to declare a local function within an expression.
-The macros automatically detect if the compiler supports __CPP11_lambda__ functions in which case the implementation uses native lambdas instead of local functions in statement expressions.
-However, __CPP11_lambda__ functions do not support constant binding so it is best to only use `const bind variable` (same as __CPP11_lambda__ `=variable`) and `bind& variable` (same as __CPP11_lambda__ `&variable`) because these have the exact same semantic between the local function and native lambda implementation.
-Unfortunately, the __CPP11_lambda__ short-hand binds `&` and `=` (which automatically bind all variables in scope either by reference or value) are not supported by the macros because they are not supported by the local function implementation.
-Finally, the result type `return `[^['result-type]] is optional and it is assumed `void` when it is not specified (same as with __CPP11_lambda__ functions).
+The macros automatically detect if the compiler supports __CXX11_lambda_functions__ in which case the implementation uses native lambdas instead of local functions in GCC statement expressions.
+However, __CXX11_lambda_functions__ do not support constant binding so it is best to only use `const bind variable` (same as `=variable` for __CXX11_lambda_functions__) and `bind& variable` (same as `&variable` for __CXX11_lambda_functions__') because these have the exact same semantic between the local function and the native lambda implementations.
+Furthermore, local functions allow to bind data members directly while __CXX11_lambda_functions__ require to access data members via binding the object `this`.
+Unfortunately, the short-hand binds `&` and `=` of __CXX11_lambda_functions__ (which automatically bind all variables in scope either by reference or value) are not supported by these GCC lambda function macros because they are not supported by local functions.
+Finally, the result type `return `[^['result-type]] is optional and it is assumed `void` when it is not specified (same as with __CXX11_lambda_functions__).
 
 [endsect]
 
@@ -45,8 +49,8 @@
     assert(x = y); // Mistakenly `=` instead of `==`.
 
 Ideally this code will not compile instead this example not only compiles but the assertion even passes the run-time check and no error is generated at all.
-The __N1613__ paper introduces the idea of a /const-block/ which could be used to wrap the assertion above and catch the programming error at compile-time.
-Similarly, the following code will generate a compile-time error when `operator=` is mistakenly used instead of `operator==` because both `x` and `y` are made constants (using local functions) within the block of code performing the assertion (see also [@../../example/const_block_err.cpp =const_block_err.cpp=]):
+The __N1613__ paper introduces the concept of a /const-block/ which could be used to wrap the assertion above and catch the programming error at compile-time.
+Similarly, the following code will generate a compile-time error when `operator=` is mistakenly used instead of `operator==` because both `x` and `y` are made constants (using local functions) within the block of code performing the assertion (see also [@../../example/const_block_error.cpp =const_block_error.cpp=]):
 
 [table
     [ [With Local Functions] [N1613 Const-Blocks] ]
@@ -58,17 +62,25 @@
     ``] ]
 ]
 
-Where the macros are defined in [@../../example/const_block.hpp =const_block.hpp=].
+The constant block macros are implemented using local functions (see also [@../../example/const_block.hpp =const_block.hpp=]):
+
+[const_block_macro]
+[const_block_end_macro]
 
 The constant block macros are implemented using a local function which binds by constant reference `const bind&` all the specified variables (so the variables are constant within the code block but they do not need to be `CopyConstructible` and no extra copy is performed).
-The local function executes the `assert` instruction in its body which is called immediately after it is defined.
+The local function executes the `assert` instruction in its body and it is called immediately after it is defined.
 More in general, constant blocks can be used to evaluate any instruction (not just assertions) within a block were all specified variables are constant.
 
-Unfortunately, constant blocks cannot be implemented with __CPP11_lambda__ functions because these do not support constant binding (of course it is always possible to introduce extra constant variables `const int& const_x = x`, etc and use these variables in the assertion).
-Variables bound by value using __CPP11_lambda__ functions (`variable`, `=variable`, and `=`) are constant but they are required to be `CopyConstructible` and they introduce potentially expensive copy operations.
+Unfortunately, constant blocks cannot be implemented with __CXX11_lambda_functions__ because these do not support constant binding.
+Variables bound by value using __CXX11_lambda_functions__ (`variable`, `=variable`, and `=`) are constant but they are required to be `CopyConstructible` and they introduce potentially expensive copy operations.
 [footnote
-Ideally, __CPP11_lambda__ functions would allow to bind variables also using `const& variable` (constant reference) and `const&` (all variables by constant reference).
+Ideally, __CXX11_lambda_functions__ would allow to bind variables also using `const& variable` (constant reference) and `const&` (all variables by constant reference).
 ]
+Of course it is always possible to introduce extra constant variables and bind these variables to the __CXX11_lambda_functions__ but the constant block code will then have to manage the declaration and initialization of these extra variables plus it will have to use the extra variable names instead of the original variable names:
+
+[const_block_cxx11_lambda]
+
+In many cases the use of an extra constant variable `const_x` can be acceptable but in other cases it might be preferable to maintain the same variable name `x` within the function body.
 
 [endsect]
 
@@ -79,29 +91,30 @@
 For curiosity, here we show how to re-implement scope exits using local functions.
 One small advantage of scope exits that use local functions is that they support constant binding.
 __Boost_ScopeExit__ does not directly support constant binding (however, it is always possible to introduce an extra `const` local variable, assign it to the value to bind, and then bind the `const` variable so to effectively have constant binding with __Boost_ScopeExit__ as well).
-In general, the authors recommend to use __Boost_ScopeExit__ instead of the code listed here whenever possible.
+
+[note
+In general, the authors recommend to use __Boost_ScopeExit__ instead of the code listed by this example whenever possible (because __Boost_ScopeExit__ is a library deliberately designed to support the scope exit construct).
+]
 
 The following example binds `p` by constant reference so this variable cannot be modified within the scope exit body but it is not copied and it will present the value it has at the exit of the enclosing scope and not at the scope exit declaration (see also [@../../example/scope_exit.cpp =scope_exit.cpp=]):
 
 [table
     [ [With Local Functions] [Boost.ScopeExit] ]
- [ [[scope_exit]] [
-[pre
+ [ [[scope_exit]] [``
     person& p = persons_.back();
     person::evolution_t checkpoint = p.evolution_;
 
     BOOST_SCOPE_EXIT(checkpoint, &p, this_) { // Or extra variable `const_p`.
         if (checkpoint == p.evolution_) this_->persons_.pop_back();
     } BOOST_SCOPE_EXIT_END
+ ``] ]
 ]
- ] ]
-]
-
-Where the macros are defined in [@../../example/scope_exit.hpp =scope_exit.hpp=].
 
-The scope exit macros are implemented by passing a local function when constructing an object of the following class:
+The scope exit macros are implemented by passing a local function when constructing an object of the following class (see also [@../../example/scope_exit.hpp =scope_exit.hpp=]):
 
 [scope_exit_class]
+[scope_exit_macro]
+[scope_exit_end_macro]
 
 A local variable within the enclosing scope is used to hold the object so the destructor will be invoked at the exit of the enclosing scope and it will in turn call the local function executing the scope exit instructions.
 The scope exit local function has no parameter and `void` result type but it supports binding and constant binding.
@@ -121,15 +134,15 @@
 This is presented here mainly as a curiosity because __Boost_Phoenix__ functions created from local functions have the important limitation that they cannot be polymorphic.
 [footnote
 *Rationale.*
-Local functions can only be monomorphic because they are implemented using local classes and local classes cannot be templates in C++ (not even in __CPP11__).
+Local functions can only be monomorphic because they are implemented using local classes and local classes cannot be templates in C++ (not even in __CXX11__).
 ]
-Therefore, in many cases creating the __Boost_Phoenix__ function from global functors (possibly with the help of __Boost_Phoenix__ adaptor macros) might be a more valuable option.
+Therefore, in many cases creating the __Boost_Phoenix__ function from global functors (possibly with the help of __Boost_Phoenix__ adaptor macros) might be a more useful.
 
 [endsect]
 
 [section Closures]
 
-The following are examples of [@http://en.wikipedia.org/wiki/Closure_(computer_science) closures] that illustrate how to return local functions to the calling scope (and the relative precautions to take).
+The following are examples of [@http://en.wikipedia.org/wiki/Closure_(computer_science) closures] that illustrate how to return local functions to the calling scope (note how extra care is taken in order to ensure that all bound variables remain valid at the calling scope):
 
 [table
     [ [Files] ]
@@ -143,10 +156,10 @@
 
 [section GCC Nested Functions]
 
-The GCC C compiler supports local functions under the name of [@http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html nested functions].
-Nested functions are exclusively a C extension of the GCC compiler (they are not supported for C++ not even by the GCC compiler, and they are not part of any C or C++ standard, nor they are supported by other compilers like MSVC).
+The GCC C compiler supports local functions as a non-standard extension under the name of [@http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html nested functions].
+Note that nested functions are exclusively a C extension of the GCC compiler (they are not supported for C++ not even by the GCC compiler, and they are not part of any C or C++ standard, nor they are supported by other compilers like MSVC).
 
-The following examples are taken form the GCC nested function documentation and programmed using this library:
+The following examples are taken form the GCC nested function documentation and programmed using local functions:
 
 [table
     [ [Files] ]
@@ -159,15 +172,15 @@
 
 [section N-Papers]
 
-The following examples are taken from a number of N-papers and programmed using this library.
+The following examples are taken from different C++ "N-papers" and programmed using local functions:
 
 [table
     [ [Files] [Notes] ]
     [ [[@../../example/n2550_find_if.cpp =n2550_find_if.cpp=]] [
-This example is adapted from __N2550__ (__CPP11_lambda__ functions): It passes a local function to the STL algorithm `std::find_if`.
+This example is adapted from __N2550__ (__CXX11_lambda_functions__): It passes a local function to the STL algorithm `std::find_if`.
     ] ]
     [ [[@../../example/n2529_this.cpp =n2529_this.cpp=]] [
-This example is adapted from __N2529__ (__CPP11_lambda__ functions): It binds the object in scope `this` to a local function.
+This example is adapted from __N2529__ (__CXX11_lambda_functions__): It binds the object in scope `this` to a local function.
     ] ]
 ]
 

Modified: branches/release/libs/local_function/doc/getting_started.qbk
==============================================================================
--- /trunk/libs/local_function/doc/getting_started.qbk (original)
+++ branches/release/libs/local_function/doc/getting_started.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,9 +5,9 @@
 [/ http://www.boost.org/LICENSE_1_0.txt) ]
 [/ Home at http://www.boost.org/libs/local_function ]
 
-[section:Getting_Started Getting Started]
+[section Getting Started]
 
-This section explains how programmers can setup their system to use this library.
+This section explains how to setup a system to use this library.
 
 [section This Documentation]
 
@@ -18,25 +18,25 @@
 Some footnotes are marked by the word "*Rationale*".
 They explain reasons behind decisions made during the design and implementation of this library.
 
-In some of the examples presented in this documentation, the __Boost_Test__ macro `BOOST_CHECK` is used equivalently to `assert` and the __Boost_Test__ macro `BOOST_AUTO_TEST_CASE` is used equivalently to `main`.
+In most of the examples presented in this documentation, the Boost.Detail/LightweightTest (=boost/detail/lightweight_test.hpp=) macro `BOOST_TEST` is used to check correctness conditions.
+The `BOOST_TEST` macro is conceptually similar to `assert` but a failure of the checked condition does not abort the program, instead it makes `boost::report_errors` return a non-zero program exit code.
 [footnote
 *Rationale.*
-Using __Boost_Test__ allows to add the documentation examples to the library regression tests so to make sure that the listed examples always compile and run correctly.
+Using Boost.Detail/LightweightTest allows to add the examples to the library regression tests so to make sure that they always compile and run correctly.
 ]
 
 [endsect]
 
 [section Compilers and Platforms]
 
-The implementation of this library uses preprocessor and template meta-programming (as supported by __Boost_Preprocessor__ and __Boost_MPL__), templates with partial specializations and function pointers (similarly to __Boost_Function__).
-As a consequence, this library is fairly demanding on compilers' compliance with the __CPP03__ standard.
-At present, this library has been successfully compiled and tested on the following compilers and platforms:
-
-# GNU Compiler Collection (GCC) 4.5.1 on Ubuntu Linux 10.
-# GCC 4.3.4 and 4.5.3 (with and without __CPP11__ features enabled `-std=c++0x`) on Cygwin.
-# Miscrosoft Visual Studio Compiler (MSVC) 8.0 on Windows XP and Windows 7.
+The implementation of this library uses preprocessor and template meta-programming (as supported by __Boost_Preprocessor__ and __Boost_MPL__), templates with partial specializations and function pointers (similarly to __Boost_Function__), and automatic type deduction (as supported by __Boost_Typeof__).
+The authors originally developed and tested the library on:
 
-This library has not yet been tested on any other compiler and platform.
+# GNU Compiler Collection (GCC) C++ 4.5.1 on Ubuntu Linux 10.
+# GCC 4.3.4 and 4.5.3 (with and without __CXX11__ features enabled `-std=c++0x`) on Cygwin.
+# Miscrosoft Visual C++ (MSVC) 8.0 on Windows XP and Windows 7.
+
+See the library [@http://www.boost.org/development/tests/release/developer/local_function.html regressions test results] for detailed information on supported compilers and platforms.
 
 [endsect]
 
@@ -46,15 +46,15 @@
 Therefore there is no pre-compiled object file which needs to be installed or linked.
 Programmers can simply instruct the C++ compiler where to find the library header files (`-I` option for GCC, `/I` option for MSVC, etc) and they can start compiling code using this library.
 
-This library implementation uses a number of __Boost__ libraries among which: __Boost_Preprocessor__, __Boost_ScopeExit__, __Boost_Typeof__, __Boost_TypeTraits__, and __Boost_MPL__.
-These __Boost__ libraries must be properly installed on your system in order for this library to work.
+The library implementation uses __Boost_Typeof__ to automatically deduce the types of bound variables (see the __Tutorial__ section).
+In order to compile code in type-of emulation mode, all types should be properly registered using `BOOST_TYPEOF_REGISTER_TYPE` and `BOOST_TYPEOF_REGISTER_TEMPLATE`, or appropriate __Boost_Typeof__ headers should be included (see the source code of most examples presented in this documentation).
 
 The followings are part of the library private API, they are not documented, and they should not be directly used by programmers:
 [footnote
 *Rationale.*
-This library concatenates symbols specified by the programmers (e.g., the local function name) with other symbols (e.g., special prefixes or preprocessor line numbers) to make internal symbols with unique names to avoid name clashes.
+This library concatenates symbols specified by the programmers (e.g., the local function name) with other symbols (e.g., special prefixes or file line numbers) to make internal symbols with unique names to avoid name clashes.
 These symbols are separated by the letter "`X`" when they are concatenated so they read more easily during debugging (the underscore character "`_`" could not be used instead of the letter "`X`" because if the original symbols already contained a leading or trailing underscore, the concatenation could result in a symbol with double underscores "`__`" which is reserved by the C++ standard).
-The "aux" symbols are private to this library while the "detail" symbols can be used within Boost by other libraries but they are still not part of this library public API.
+The "aux" symbols are private to this library while the "detail" symbols may be used within Boost by other libraries but they are still not part of this library public API.
 ]
 
 * Any symbol defined by files within the =boost/local_function/aux_/= or =boost/local_function/detail/= directory (these header files should not be directly included by programmers).
@@ -62,13 +62,8 @@
 * Any symbol prefixed by `boost_local_function_aux_...` or `boost_local_function_detail_...` (regardless of its namespace).
 * Any symbol prefixed by `BOOST_LOCAL_FUNCTION_AUX_...` or `BOOST_LOCAL_FUNCTION_DETAIL_...` (regardless of its namespace).
 
-[endsect]
-
-[section Configuration]
-
 Some of the library behaviour can be changed at compile-time by defining special /configuration macros/.
 If a configuration macro is left undefined, the library will use an appropriate default value for it.
-
 All configuration macros are defined in the header file [headerref boost/local_function/config.hpp].
 It is strongly recommended not to change the library configuration macro definitions unless strictly necessary.
 

Modified: branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION.html
==============================================================================
--- /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION.html (original)
+++ branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -33,18 +33,18 @@
 
 </span>BOOST_LOCAL_FUNCTION(declarations)</pre></div>
 <div class="refsect1">
-<a name="id878789"></a><h2>Description</h2>
+<a name="id859236"></a><h2>Description</h2>
 <p>This macro must be used within a declarative context, it must follow the local function result type, it must be followed by the local function body code, and then by the <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code> macro (see the <a class="link" href="boost_localfunction/Tutorial.html" title="Tutorial">Tutorial</a> and <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> sections): </p>
 <pre class="programlisting"><span class="special">{</span> <span class="comment">// Some declarative context.</span>
     <span class="special">...</span>
     <span class="identifier">result_type</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="identifier">declarations</span><span class="special">)</span> <span class="special">{</span>
         <span class="special">...</span> <span class="comment">// Body code.</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">qualified_function_name</span><span class="special">)</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">qualified_name</span><span class="special">)</span>
     <span class="special">...</span>
 <span class="special">}</span>
 </pre>
 <p>As usual, exceptions specifications can be optionally programmed just after the macro and before the body code block <code class="computeroutput">{ ... }</code> (but the exception specifications will only apply to the body code and not to the library code automatically generated by the macro expansion, see the <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section).</p>
-<p>Within templates, the special macro <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code> must be used instead of <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>.</p>
+<p>Within templates, the special macros <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code> and <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_NAME_TPL">BOOST_LOCAL_FUNCTION_NAME_TPL</a></code> must be used.</p>
 <p><span class="bold"><strong>Parameters:</strong></span> </p>
 <div class="informaltable"><table class="table">
 <colgroup>
@@ -71,19 +71,19 @@
             <span class="keyword">return</span> <span class="identifier">function_result_type</span>
 </pre> On compilers that do not support variadic macros, <code class="computeroutput">declaration_tuple</code> cannot be used: <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <span class="identifier">declarations</span><span class="special">:</span>
             <span class="keyword">void</span> <span class="special">|</span> <span class="identifier">declaration_sequence</span>
-</pre>Lexical conventions: <code class="computeroutput">token1 | token2</code> means either <code class="computeroutput">token1</code> or <code class="computeroutput">token2</code>; <code class="computeroutput">[token]</code> means either <code class="computeroutput">token</code> or nothing; <code class="computeroutput">{expression}</code> means the token resulting from the expression. </td>
+</pre>(Lexical conventions: <code class="computeroutput">token1 | token2</code> means either <code class="computeroutput">token1</code> or <code class="computeroutput">token2</code>; <code class="computeroutput">[token]</code> means either <code class="computeroutput">token</code> or nothing; <code class="computeroutput">{expression}</code> means the token resulting from the expression.) </td>
 </tr></tbody>
 </table></div>
 <p>
 </p>
-<p>Note that on compilers that support variadic macros, commas can be used to separate the declarations resembling more closely the usual C++ function declaration syntax. This is the preferred syntax. However, for portability, on all C++ compilers (with and without variadic macros) the same library macros also accept parameter declarations specified as a Boost.Preprocessor sequence separated by round parenthesis <code class="computeroutput">()</code>.</p>
+<p>Note that on compilers that support variadic macros, commas can be used to separate the declarations resembling more closely the usual C++ function declaration syntax (this is the preferred syntax). However, for portability, on all C++ compilers (with and without variadic macros) the same library macros also accept parameter declarations specified as a Boost.Preprocessor sequence separated by round parenthesis <code class="computeroutput">()</code>.</p>
 <p>When binding the object <code class="computeroutput">this</code>, the special symbol <code class="computeroutput">this_</code> needs to be used instead of <code class="computeroutput">this</code> as the name of the variable to bind and also within the local function body to access the object. (Mistakenly using <code class="computeroutput">this</code> instead of <code class="computeroutput">this_</code> might not always result in a compiler error and will in general result in undefined behaviour.)</p>
 <p>The result type must either be specified just before the macro or within the macro declarations prefixed by <code class="computeroutput">return</code> (but not in both places).</p>
 <p>Within the local function body it possible to access the result type using <code class="computeroutput">result_type</code>, the type of the first parameter using <code class="computeroutput">arg1_type</code>, the type of the second parameter using <code class="computeroutput">arg2_type</code>, etc. The bound variable types can be accessed using <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TYPEOF.html" title="Macro BOOST_LOCAL_FUNCTION_TYPEOF">BOOST_LOCAL_FUNCTION_TYPEOF</a></code>.</p>
-<p>The maximum number of local function parameters (excluding bound variables) is specified by the configuration macro <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX">BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX</a></code>. The maximum number of bound variables is specified by the configuration macro <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX">BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX</a></code>.</p>
+<p>This macro cannot be portably expanded multiple times on the same line. In these cases, use the <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_ID.html" title="Macro BOOST_LOCAL_FUNCTION_ID">BOOST_LOCAL_FUNCTION_ID</a></code> macro instead.</p>
+<p>The maximum number of local function parameters (excluding bound variables) is specified by the configuration macro <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX">BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX</a></code>. The maximum number of bound variables is specified by the configuration macro <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX">BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX</a></code>. The configuration macro <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS">BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS</a></code> can be used to force optimizations that reduce the local function call run-time overhead.</p>
 <p><span class="bold"><strong>Note:</strong></span> Local functions are functors so they can be assigned to other functors like <code class="computeroutput">boost::function</code> (see Boost.Function).</p>
-<p><span class="bold"><strong>Note:</strong></span> This macro cannot be portably used multiple times on the same line (because on GCC and other compilers, it internally uses the line number <code class="computeroutput">__LINE__</code> to generate unique identifiers).</p>
-<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_localfunction/Tutorial.html" title="Tutorial">Tutorial</a> section, <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TYPEOF.html" title="Macro BOOST_LOCAL_FUNCTION_TYPEOF">BOOST_LOCAL_FUNCTION_TYPEOF</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX">BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNC
TION_CONFIG_BIND_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX">BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX</a></code>. </p>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_localfunction/Tutorial.html" title="Tutorial">Tutorial</a> section, <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_NAME_TPL">BOOST_LOCAL_FUNCTION_NAME_TPL</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TYPEOF.html" title="Macro BOOST_LOCAL_FUNCTION_TYPEOF">BOOST_LOCAL_FUNCTION_TYPEOF</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_ID.html" title="Mac
ro BOOST_LOCAL_FUNCTION_ID">BOOST_LOCAL_FUNCTION_ID</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX">BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX">BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS">BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS</a></code>. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

Modified: branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html
==============================================================================
--- /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html (original)
+++ branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX</pre></div>
 <div class="refsect1">
-<a name="id881266"></a><h2>Description</h2>
+<a name="id861380"></a><h2>Description</h2>
 <p>If programmers leave this configuration macro undefined, its default value is <code class="computeroutput">5</code> (increasing this number might increase compilation time). When defined by programmers, this macro must be a non-negative integer number.</p>
 <p><span class="bold"><strong>Note:</strong></span> This macro specifies the maximum number of local function parameters excluding bound variables (which are instead specified by <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX">BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX</a></code>).</p>
 <p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_localfunction/Tutorial.html" title="Tutorial">Tutorial</a> section, <a class="link" href="boost_localfunction/Getting_Started.html" title="Getting Started"> Getting Started</a> section, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX">BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX</a></code>. </p>

Modified: branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html
==============================================================================
--- /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html (original)
+++ branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,7 +7,7 @@
 <link rel="home" href="index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
 <link rel="up" href="reference.html#header.boost.local_function.config_hpp" title="Header &lt;boost/local_function/config.hpp&gt;">
 <link rel="prev" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX">
-<link rel="next" href="boost_localfunction/Alternatives.html" title="Annex: Alternatives">
+<link rel="next" href="BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function.config_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost_localfunction/Alternatives.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function.config_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="refentry">
 <a name="BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX"></a><div class="titlepage"></div>
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX</pre></div>
 <div class="refsect1">
-<a name="id881341"></a><h2>Description</h2>
+<a name="id861454"></a><h2>Description</h2>
 <p>If programmers leave this configuration macro undefined, its default value is <code class="computeroutput">10</code> (increasing this number might increase compilation time). When defined by programmers, this macro must be a non-negative integer number.</p>
 <p><span class="bold"><strong>Note:</strong></span> This macro specifies the maximum number of bound variables excluding local function parameters (which are instead specified by <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX">BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX</a></code>).</p>
 <p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_localfunction/Tutorial.html" title="Tutorial">Tutorial</a> section, <a class="link" href="boost_localfunction/Getting_Started.html" title="Getting Started"> Getting Started</a> section, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX">BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX</a></code>. </p>
@@ -50,7 +50,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function.config_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost_localfunction/Alternatives.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function.config_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Copied: branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html (from r77930, /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html)
==============================================================================
--- /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html (original)
+++ branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -26,15 +26,27 @@
 <a name="BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS"></a><div class="titlepage"></div>
 <div class="refnamediv">
 <h2><span class="refentrytitle">Macro BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS</span></h2>
-<p>BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS</p>
+<p>BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS &#8212; Specify when local functions can be passed as template parameters without introducing any run-time overhead. </p>
 </div>
 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.boost.local_function.config_hpp" title="Header &lt;boost/local_function/config.hpp&gt;">boost/local_function/config.hpp</a>&gt;
 
 </span>BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS</pre></div>
 <div class="refsect1">
-<a name="id904994"></a><h2>Description</h2>
-<p>Control performance optimizations. Automatically set using Boost.Config BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS if not defined by user. 0 - no optimization, 1 - optimization. </p>
+<a name="id861529"></a><h2>Description</h2>
+<p>If this macro is defined to <code class="computeroutput">1</code>, this library will assume that the compiler allows to pass local classes as template parameters: </p>
+<pre class="programlisting"> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span><span class="special">}</span>
+
+ <span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">struct</span> <span class="identifier">local_class</span> <span class="special">{</span><span class="special">}</span><span class="special">;</span>
+ <span class="identifier">f</span><span class="special">&lt;</span><span class="identifier">local_class</span><span class="special">&gt;</span><span class="special">(</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+ <span class="special">}</span>
+</pre>
+<p> This is the case for C++11 compilers and some C++03 compilers (e.g., MSVC), but it is not the case in general for most C++03 compilers (including GCC). This will allow the library to pass local functions as template parameters without introducing any run-time overhead (specifically without preventing the compiler from optimizing local function calls by inlining their assembly code).</p>
+<p>If this macro is defined to <code class="computeroutput">0</code> instead, this library will introduce a run-time overhead associated to resolving a function pointer call in order to still allow to pass the local functions as template parameters.</p>
+<p>It is recommended to leave this macro undefined. In this case, the library will automatically define this macro to <code class="computeroutput">0</code> if the Boost.Config macro <code class="computeroutput">BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS</code> is defined for the specific compiler, and to <code class="computeroutput">1</code> otherwise.</p>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_localfunction/Getting_Started.html" title="Getting Started"> Getting Started</a> section, <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

Copied: branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_ID.html (from r77436, /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_ID.html)
==============================================================================
--- /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_ID.html (original)
+++ branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_ID.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,7 +7,7 @@
 <link rel="home" href="index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
 <link rel="up" href="reference.html#header.boost.local_function_hpp" title="Header &lt;boost/local_function.hpp&gt;">
 <link rel="prev" href="BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">
-<link rel="next" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">
+<link rel="next" href="BOOST_LOCAL_FUNCTION_TPL_ID.html" title="Macro BOOST_LOCAL_FUNCTION_TPL_ID">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -20,21 +20,21 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_LOCAL_FUNCTION_TPL.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_NAME.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_LOCAL_FUNCTION_TPL.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_TPL_ID.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="refentry">
 <a name="BOOST_LOCAL_FUNCTION_ID"></a><div class="titlepage"></div>
 <div class="refnamediv">
 <h2><span class="refentrytitle">Macro BOOST_LOCAL_FUNCTION_ID</span></h2>
-<p>BOOST_LOCAL_FUNCTION_ID &#8212; This macro allows to expand multiple local function macros on the same line. </p>
+<p>BOOST_LOCAL_FUNCTION_ID &#8212; This macro allows to declare multiple local functions on the same line. </p>
 </div>
 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.boost.local_function_hpp" title="Header &lt;boost/local_function.hpp&gt;">boost/local_function.hpp</a>&gt;
 
-</span>BOOST_LOCAL_FUNCTION_ID(id, within_template, declarations)</pre></div>
+</span>BOOST_LOCAL_FUNCTION_ID(id, declarations)</pre></div>
 <div class="refsect1">
-<a name="id882031"></a><h2>Description</h2>
-<p>This macro is equivalent to <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code> but it can be expanded multiple times on the same line if different identifiers <code class="computeroutput">id</code> are provided for each expansion (see <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code> for more detail).</p>
+<a name="id860164"></a><h2>Description</h2>
+<p>This macro is equivalent to <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code> but it can be expanded multiple times on the same line if different identifiers <code class="computeroutput">id</code> are provided for each expansion (see the <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section).</p>
 <p><span class="bold"><strong>Parameters:</strong></span> </p>
 <div class="informaltable"><table class="table">
 <colgroup>
@@ -44,11 +44,7 @@
 <tbody>
 <tr>
 <td><span class="bold"><strong><code class="computeroutput">id</code></strong></span></td>
-<td>A unique identifier token which can be catted by the preprocessor (for example <code class="computeroutput">__LINE__</code> or <code class="computeroutput">local_function_number_1_on_line_123</code>). </td>
-</tr>
-<tr>
-<td><span class="bold"><strong><code class="computeroutput">within_template</code></strong></span></td>
-<td>Specify <code class="computeroutput">1</code> when this macro is used in a type-dependant context, <code class="computeroutput">0</code> otherwise (this is equivalent to using <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code> on separate lines). </td>
+<td>A unique identifier token which can be concatenated by the preprocessor (<code class="computeroutput">__LINE__</code>, <code class="computeroutput">local_function_number_1_on_line_123</code>, etc). </td>
 </tr>
 <tr>
 <td><span class="bold"><strong><code class="computeroutput">declarations</code></strong></span></td>
@@ -58,8 +54,10 @@
 </table></div>
 <p>
 </p>
-<p><span class="bold"><strong>Note:</strong></span> This macro can be useful when the local function macros are expanded within user-defined macros (because macros all expand on the same line). On some compilers (e.g., MSVC which supports the non standard <code class="computeroutput">__COUNTER__</code> macro) it might not be necessary to use this macro but the use of this macro when expanding multiple local function macros on the same line is always necessary to ensure portability (this is because this library can only portably use <code class="computeroutput">__LINE__</code> to internally generate unique identifiers).</p>
-<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">BOOST_SCOPE_EXIT_END_ID</code>, <code class="computeroutput">BOOST_SCOPE_EXIT_ALL_ID</code>, <code class="computeroutput">BOOST_SCOPE_EXIT</code>, <code class="computeroutput">BOOST_SCOPE_EXIT_TPL</code>. </p>
+<p>The <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code> macro should be used to end each one of the multiple local function declarations as usual (and it will specify a unique name for each local function).</p>
+<p>Within templates, the special macros <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TPL_ID.html" title="Macro BOOST_LOCAL_FUNCTION_TPL_ID">BOOST_LOCAL_FUNCTION_TPL_ID</a></code> must be used.</p>
+<p><span class="bold"><strong>Note:</strong></span> This macro can be useful when the local function macros are expanded within user-defined macros (because macros all expand on the same line). On some compilers (e.g., MSVC which supports the non-standard <code class="computeroutput">__COUNTER__</code> macro) it might not be necessary to use this macro but the use of this macro when expanding multiple local function macros on the same line is always necessary to ensure portability (this is because this library can only portably use <code class="computeroutput">__LINE__</code> to internally generate unique identifiers).</p>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TPL_ID.html" title="Macro BOOST_LOCAL_FUNCTION_TPL_ID">BOOST_LOCAL_FUNCTION_TPL_ID</a></code>. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
@@ -73,7 +71,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_LOCAL_FUNCTION_TPL.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_NAME.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_LOCAL_FUNCTION_TPL.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_TPL_ID.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_NAME.html
==============================================================================
--- /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_NAME.html (original)
+++ branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_NAME.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,8 +6,8 @@
 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 <link rel="home" href="index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
 <link rel="up" href="reference.html#header.boost.local_function_hpp" title="Header &lt;boost/local_function.hpp&gt;">
-<link rel="prev" href="BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">
-<link rel="next" href="BOOST_LOCAL_FUNCTION_TYPEOF.html" title="Macro BOOST_LOCAL_FUNCTION_TYPEOF">
+<link rel="prev" href="BOOST_LOCAL_FUNCTION_TPL_ID.html" title="Macro BOOST_LOCAL_FUNCTION_TPL_ID">
+<link rel="next" href="BOOST_LOCAL_FUNCTION_NAME_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_NAME_TPL">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_LOCAL_FUNCTION_TPL.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_TYPEOF.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_LOCAL_FUNCTION_TPL_ID.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_NAME_TPL.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="refentry">
 <a name="BOOST_LOCAL_FUNCTION_NAME"></a><div class="titlepage"></div>
@@ -31,18 +31,19 @@
 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.boost.local_function_hpp" title="Header &lt;boost/local_function.hpp&gt;">boost/local_function.hpp</a>&gt;
 
-</span>BOOST_LOCAL_FUNCTION_NAME(qualified_function_name)</pre></div>
+</span>BOOST_LOCAL_FUNCTION_NAME(qualified_name)</pre></div>
 <div class="refsect1">
-<a name="id880744"></a><h2>Description</h2>
+<a name="id860548"></a><h2>Description</h2>
 <p>This macro must follow the local function body code block <code class="computeroutput">{ ... }</code>: </p>
 <pre class="programlisting"><span class="special">{</span> <span class="comment">// Some declarative context.</span>
     <span class="special">...</span>
     <span class="identifier">result_type</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="identifier">declarations</span><span class="special">)</span> <span class="special">{</span>
         <span class="special">...</span> <span class="comment">// Body code.</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">qualified_function_name</span><span class="special">)</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">qualified_name</span><span class="special">)</span>
     <span class="special">...</span>
 <span class="special">}</span>
 </pre>
+<p>Within templates, the special macros <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code> and <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_NAME_TPL">BOOST_LOCAL_FUNCTION_NAME_TPL</a></code> must be used.</p>
 <p><span class="bold"><strong>Parameters:</strong></span> </p>
 <div class="informaltable"><table class="table">
 <colgroup>
@@ -50,18 +51,26 @@
 <col>
 </colgroup>
 <tbody><tr>
-<td><span class="bold"><strong><code class="computeroutput">qualified_function_name</code></strong></span></td>
-<td>The name of the local function optionally qualified as follow: <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">qualified_function_name</span><span class="special">:</span>
- <span class="special">[</span><span class="keyword">inline</span><span class="special">]</span> <span class="special">[</span><span class="identifier">recursive</span><span class="special">]</span> <span class="identifier">name</span>
-</pre> Lexical conventions: <code class="computeroutput">token1 | token2</code> means either <code class="computeroutput">token1</code> or <code class="computeroutput">token2</code>; <code class="computeroutput">[token]</code> means either <code class="computeroutput">token</code> or nothing; <code class="computeroutput">{expression}</code> means the token resulting from the expression. </td>
+<td><span class="bold"><strong><code class="computeroutput">qualified_name</code></strong></span></td>
+<td>The name of the local function optionally qualified as follow: <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <span class="identifier">name</span><span class="special">:</span>
+ <span class="special">[</span><span class="keyword">inline</span><span class="special">]</span> <span class="special">[</span><span class="identifier">recursive</span><span class="special">]</span> <span class="identifier">local_function_name</span>
+</pre> (Lexical conventions: <code class="computeroutput">token1 | token2</code> means either <code class="computeroutput">token1</code> or <code class="computeroutput">token2</code>; <code class="computeroutput">[token]</code> means either <code class="computeroutput">token</code> or nothing; <code class="computeroutput">{expression}</code> means the token resulting from the expression.) </td>
 </tr></tbody>
 </table></div>
 <p>
 </p>
-<p>The local function name can be qualified by prefixing it with the keyword <code class="computeroutput">inline</code> (see the <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section): <code class="computeroutput">BOOST_LOCAL_FUNCTION_NAME(inline name)</code>. This increases the chances that the compiler will be able to inline the local function calls (thus reducing run-time). However, inlined local functions cannot be passed as template parameters (e.g., to <code class="computeroutput">std::for_each</code>) or assigned to other functors (e.g., to <code class="computeroutput">boost::function</code>). That is true on C++03 compilers but inlined local functions can instead be passed as template parameters on C++11 compilers. On C++11 compilers, there is no need to declare a local function lined because this library will automatically use C++11 specific features to inline the local function while always allowing to pass it as a template parameter.
</p>
-<p>The local function name can also be qualified by prefixing it with the "keyword" <code class="computeroutput">recursive</code> (see the <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section): <code class="computeroutput">BOOST_LOCAL_FUNCTION_NAME(recursive name)</code>. This allows the local function to recursively call itself from its body (as usual in C++). However, compilers have not been observed to be able to inline recursive local function calls (not even when the recursive local function is also declared inline: <code class="computeroutput">BOOST_LOCAL_FUNCTION(inline recursive name)</code>). Furthermore, recursive local functions should only be called within their declaration scope (otherwise the result is undefined behaviour).</p>
+<p>The local function name can be qualified by prefixing it with the keyword <code class="computeroutput">inline</code> (see the <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section): </p>
+<pre class="programlisting"> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="keyword">inline</span> <span class="identifier">local_function_name</span><span class="special">)</span>
+</pre>
+<p> This increases the chances that the compiler will be able to inline the local function calls (thus reducing run-time). However, inline local functions cannot be passed as template parameters (e.g., to <code class="computeroutput">std::for_each</code>) or assigned to other functors (e.g., to <code class="computeroutput">boost::function</code>). That is true on C++03 compilers but inline local functions can instead be passed as template parameters on C++11 compilers. On C++11 compilers, there is no need to declare a local function lined because this library will automatically use C++11 specific features to inline the local function while always allowing to pass it as a template parameter. This optimization is automatically enabled when the Boost.Config macro <code class="computeroutput">BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS</code> is not defined but it also be forced using <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html" title="Macro BOOST_LOCAL_FU
NCTION_CONFIG_LOCALS_AS_TPARAMS">BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS</a></code>.</p>
+<p>The local function name can also be qualified by prefixing it with the "keyword" <code class="computeroutput">recursive</code> (see the <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section): </p>
+<pre class="programlisting"> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">recursive</span> <span class="identifier">local_function_name</span><span class="special">)</span>
+</pre>
+<p> This allows the local function to recursively call itself from its body (as usual in C++). However, recursive local functions should only be called within their declaration scope (otherwise the result is undefined behaviour). Finally, compilers have not been observed to be able to inline recursive local function calls, not even when the recursive local function is also declared inline: </p>
+<pre class="programlisting"> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">inline</span> <span class="identifier">recursive</span> <span class="identifier">local_function_name</span><span class="special">)</span>
+</pre>
 <p><span class="bold"><strong>Note:</strong></span> The local function name cannot be the name of an operator <code class="computeroutput">operator...</code> and it cannot be the same name of another local function declared within the same enclosing scope (but <code class="computeroutput">boost::overloaded_function</code> can be used to overload local functions, see Boost.Functional/OverloadedFunction and the <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section).</p>
-<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_localfunction/Tutorial.html" title="Tutorial">Tutorial</a> section, <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>. </p>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_localfunction/Tutorial.html" title="Tutorial">Tutorial</a> section, <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_NAME_TPL">BOOST_LOCAL_FUNCTION_NAME_TPL</a></code>. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
@@ -75,7 +84,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_LOCAL_FUNCTION_TPL.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_TYPEOF.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_LOCAL_FUNCTION_TPL_ID.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_NAME_TPL.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Copied: branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_NAME_TPL.html (from r77930, /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_NAME_TPL.html)
==============================================================================
--- /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_NAME_TPL.html (original)
+++ branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_NAME_TPL.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -26,15 +26,26 @@
 <a name="BOOST_LOCAL_FUNCTION_NAME_TPL"></a><div class="titlepage"></div>
 <div class="refnamediv">
 <h2><span class="refentrytitle">Macro BOOST_LOCAL_FUNCTION_NAME_TPL</span></h2>
-<p>BOOST_LOCAL_FUNCTION_NAME_TPL</p>
+<p>BOOST_LOCAL_FUNCTION_NAME_TPL &#8212; This macro is used to end a local function declaration specifying its name within templates. </p>
 </div>
 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.boost.local_function_hpp" title="Header &lt;boost/local_function.hpp&gt;">boost/local_function.hpp</a>&gt;
 
-</span>BOOST_LOCAL_FUNCTION_NAME_TPL(qualified_function_name)</pre></div>
+</span>BOOST_LOCAL_FUNCTION_NAME_TPL(name)</pre></div>
 <div class="refsect1">
-<a name="id904596"></a><h2>Description</h2>
-<p>In type-dependant context. </p>
+<a name="id860960"></a><h2>Description</h2>
+<p>This macro must be used instead of <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code> when declaring a local function within a template. A part from that, this macro has the exact same syntax a <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code> (see <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code> for more information): </p>
+<pre class="programlisting"><span class="special">{</span> <span class="comment">// Some declarative context within a template.</span>
+ <span class="special">...</span>
+ <span class="identifier">result_type</span> <span class="identifier">BOOST_LOCAL_FUNCTION_TPL</span><span class="special">(</span><span class="identifier">declarations</span><span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span> <span class="comment">// Body code.</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME_TPL</span><span class="special">(</span><span class="identifier">qualified_name</span><span class="special">)</span>
+ <span class="special">...</span>
+<span class="special">}</span>
+</pre>
+<p>Note that <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code> must be used with this macro instead of <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>.</p>
+<p><span class="bold"><strong>Note:</strong></span> C++03 does not allow to use <code class="computeroutput">typename</code> outside templates. This library internally manipulates types, these operations require <code class="computeroutput">typename</code> but only within templates. This macro is used to indicate to the library when the enclosing scope is a template so the library can correctly use <code class="computeroutput">typename</code>.</p>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_localfunction/Tutorial.html" title="Tutorial">Tutorial</a> section, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code>. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

Modified: branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_TPL.html
==============================================================================
--- /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_TPL.html (original)
+++ branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_TPL.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,7 +7,7 @@
 <link rel="home" href="index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
 <link rel="up" href="reference.html#header.boost.local_function_hpp" title="Header &lt;boost/local_function.hpp&gt;">
 <link rel="prev" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">
-<link rel="next" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">
+<link rel="next" href="BOOST_LOCAL_FUNCTION_ID.html" title="Macro BOOST_LOCAL_FUNCTION_ID">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_LOCAL_FUNCTION.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_NAME.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_LOCAL_FUNCTION.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_ID.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="refentry">
 <a name="BOOST_LOCAL_FUNCTION_TPL"></a><div class="titlepage"></div>
@@ -33,18 +33,20 @@
 
 </span>BOOST_LOCAL_FUNCTION_TPL(declarations)</pre></div>
 <div class="refsect1">
-<a name="id880567"></a><h2>Description</h2>
-<p>This macro must be used instead of <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code> when declaring a local function within a template. A part from that, this macro has the exact same syntax as <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code> (see <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code> for more information): </p>
-<pre class="programlisting"><span class="special">{</span> <span class="comment">// Some declarative context with a template.</span>
+<a name="id859948"></a><h2>Description</h2>
+<p>This macro must be used instead of <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code> when declaring a local function within a template. A part from that, this macro has the exact same syntax a <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code> (see <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code> for more information): </p>
+<pre class="programlisting"><span class="special">{</span> <span class="comment">// Some declarative context within a template.</span>
     <span class="special">...</span>
     <span class="identifier">result_type</span> <span class="identifier">BOOST_LOCAL_FUNCTION_TPL</span><span class="special">(</span><span class="identifier">declarations</span><span class="special">)</span> <span class="special">{</span>
         <span class="special">...</span> <span class="comment">// Body code.</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">qualified_function_name</span><span class="special">)</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME_TPL</span><span class="special">(</span><span class="identifier">qualified_name</span><span class="special">)</span>
     <span class="special">...</span>
 <span class="special">}</span>
 </pre>
-<p><span class="bold"><strong>Note:</strong></span> C++03 does not allow to use <code class="computeroutput">typename</code> outside templates. This library internally manipulates types, these operations require <code class="computeroutput">typename</code> but only within templates so this macro is used to indicate to the library when the enclosing scope is a template.</p>
-<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_localfunction/Tutorial.html" title="Tutorial">Tutorial</a> section, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>. </p>
+<p>Note that <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_NAME_TPL">BOOST_LOCAL_FUNCTION_NAME_TPL</a></code> must be used with this macro instead of <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>.</p>
+<p>This macro cannot be portably expanded multiple times on the same line. In these cases, use the <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TPL_ID.html" title="Macro BOOST_LOCAL_FUNCTION_TPL_ID">BOOST_LOCAL_FUNCTION_TPL_ID</a></code> macro instead.</p>
+<p><span class="bold"><strong>Note:</strong></span> C++03 does not allow to use <code class="computeroutput">typename</code> outside templates. This library internally manipulates types, these operations require <code class="computeroutput">typename</code> but only within templates. This macro is used to indicate to the library when the enclosing scope is a template so the library can correctly use <code class="computeroutput">typename</code>.</p>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_localfunction/Tutorial.html" title="Tutorial">Tutorial</a> section, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_TPL_ID.html" title="Macro BOOST_LOCAL_FUNCTION_TPL_ID">BOOST_LOCAL_FUNCTION_TPL_ID</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_NAME_TPL">BOOST_LOCAL_FUNCTION_NAME_TPL</a></code>. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
@@ -58,7 +60,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_LOCAL_FUNCTION.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_NAME.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_LOCAL_FUNCTION.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_ID.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_TYPEOF.html
==============================================================================
--- /trunk/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_TYPEOF.html (original)
+++ branches/release/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_TYPEOF.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,7 +6,7 @@
 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 <link rel="home" href="index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
 <link rel="up" href="reference.html#header.boost.local_function_hpp" title="Header &lt;boost/local_function.hpp&gt;">
-<link rel="prev" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">
+<link rel="prev" href="BOOST_LOCAL_FUNCTION_NAME_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_NAME_TPL">
 <link rel="next" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_LOCAL_FUNCTION_NAME.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_LOCAL_FUNCTION_NAME_TPL.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="refentry">
 <a name="BOOST_LOCAL_FUNCTION_TYPEOF"></a><div class="titlepage"></div>
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_FUNCTION_TYPEOF(bound_variable_name)</pre></div>
 <div class="refsect1">
-<a name="id881054"></a><h2>Description</h2>
+<a name="id861159"></a><h2>Description</h2>
 <p>This macro can be used within the local functions body to refer to the bound variable types so to declare local variables, check concepts (using Boost.ConceptCheck), etc (see the <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section). This way the local function can be programmed entirely without explicitly specifying the bound variable types thus facilitating maintenance (e.g., if the type of a bound variable changes in the enclosing scope, the local function code does not have to change).</p>
 <p><span class="bold"><strong>Parameters:</strong></span> </p>
 <div class="informaltable"><table class="table">
@@ -56,8 +56,8 @@
 <li class="listitem"><p>Bound by constant reference using <code class="computeroutput">const bind&amp; t</code> then <code class="computeroutput">BOOST_LOCAL_FUNCTION_TYPEOF(t)</code> is <code class="computeroutput">const T&amp;</code>.</p></li>
 </ul></div>
 <p>
-This macro must be prefixed by <code class="computeroutput">typename</code> when used in a type dependant context.</p>
-<p>It is best to use this macro instead of Boost.Typeof so to reduce the number of times Boost.Typeof is used to deduce types (see the <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section).</p>
+This macro must be prefixed by <code class="computeroutput">typename</code> when used within templates.</p>
+<p><span class="bold"><strong>Note:</strong></span> It is best to use this macro instead of Boost.Typeof so to reduce the number of times Boost.Typeof is used to deduce types (see the <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section).</p>
 <p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_localfunction/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>. </p>
 </div>
 </div>
@@ -72,7 +72,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_LOCAL_FUNCTION_NAME.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_LOCAL_FUNCTION_NAME_TPL.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: branches/release/libs/local_function/doc/html/boost_localfunction/Acknowledgments.html
==============================================================================
--- /trunk/libs/local_function/doc/html/boost_localfunction/Acknowledgments.html (original)
+++ branches/release/libs/local_function/doc/html/boost_localfunction/Acknowledgments.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -33,7 +33,7 @@
 <p>
       Many thanks to Steven Watanabe and Vicente Botet for suggesting to me to use
       <a href="http://www.boost.org/libs/scope_exit" target="_top">Boost.ScopeExit</a> binding
- to <a href="http://boost.2283326.n4.nabble.com/contract-diff-n1962-tt2671482.html#none" target="_top">emulate
+ to <a href="http://lists.boost.org/Archives/boost/2010/04/165149.php" target="_top">emulate
       local functions</a>. Many thanks to Alexander Nasonov for clarifying how
       <a href="http://www.boost.org/libs/scope_exit" target="_top">Boost.ScopeExit</a> binding
       could be used to implement local functions and for some <a href="http://thread.gmane.org/gmane.comp.lib.boost.devel/168612" target="_top">early
@@ -71,13 +71,12 @@
       section and with the profiling of the different alternatives.
     </p>
 <p>
- Many thanks to the library's <a href="http://lists.boost.org/boost-announce/2011/12/0340.php" target="_top">Boost
- review</a> manager: Jeffrey Lee Hellrung. Thanks also to all the people
- that submitted a (positive and negative) review: Andrzej Krzemienski, Edward
- Diener, Gregory Crosswhite, John Bytheway, Hartmut Kaiser, Krzysztof Czainski,
- Nat Lindon, Pierre Morcello, Thomas Heller, and Vicente J. Botet. Thanks to
- everyone else that commented (positively and negatively) on the library during
- its Boost review.
+ Many thanks to Jeffrey Lee Hellrung for managing the <a href="http://lists.boost.org/boost-announce/2011/12/0340.php" target="_top">Boost
+ review</a> of this library. Thanks also to all the people that submitted
+ a Boost review: Andrzej Krzemienski, Edward Diener, Gregory Crosswhite, John
+ Bytheway, Hartmut Kaiser, Krzysztof Czainski, Nat Lindon, Pierre Morcello,
+ Thomas Heller, and Vicente J. Botet. Thanks to everyone that commented on the
+ library during its Boost review.
     </p>
 <p>
       Finally, many thanks to the entire Boost

Modified: branches/release/libs/local_function/doc/html/boost_localfunction/Advanced_Topics.html
==============================================================================
--- /trunk/libs/local_function/doc/html/boost_localfunction/Advanced_Topics.html (original)
+++ branches/release/libs/local_function/doc/html/boost_localfunction/Advanced_Topics.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -31,26 +31,28 @@
       Parameters</a></span></dt>
 <dt><span class="section"><a href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.commas_and_symbols_in_macros">Commas
       and Symbols in Macros</a></span></dt>
-<dt><span class="section"><a href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.assigning_and_returning">Assigning
- and Returning</a></span></dt>
+<dt><span class="section"><a href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.assignments_and_returns">Assignments
+ and Returns</a></span></dt>
 <dt><span class="section">Nesting</span></dt>
 <dt><span class="section"><a href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.accessing_types__concepts__etc_">Accessing
       Types (concepts, etc)</a></span></dt>
-<dt><span class="section"><a href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.specifying_types">Specifying
- Types</a></span></dt>
+<dt><span class="section"><a href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.specifying_types__no_boost_typeof_">Specifying
+ Types (no Boost.Typeof)</a></span></dt>
 <dt><span class="section">Inlining</span></dt>
 <dt><span class="section">Recursion</span></dt>
 <dt><span class="section">Overloading</span></dt>
 <dt><span class="section"><a href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.exception_specifications">Exception
       Specifications</a></span></dt>
-<dt><span class="section"><a href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.storage_classifiers___auto__and__register__">Storage
- Classifiers (<code class="computeroutput"><span class="keyword">auto</span></code> and <code class="computeroutput"><span class="keyword">register</span></code>)</a></span></dt>
+<dt><span class="section"><a href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.storage_classifiers">Storage
+ Classifiers</a></span></dt>
+<dt><span class="section"><a href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.same_line_expansions">Same
+ Line Expansions</a></span></dt>
 <dt><span class="section"><a href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.limitations__operators__etc_">Limitations
       (operators, etc)</a></span></dt>
 </dl></div>
 <p>
- This section illustrates advanced usages of this library (at the bottom there
- is also a list of known limitations of the library).
+ This section illustrates advanced usage of this library. At the bottom there
+ is also a list of known limitations of this library.
     </p>
 <div class="section boost_localfunction_Advanced_Topics_default_parameters">
 <div class="titlepage"><div><div><h3 class="title">
@@ -58,10 +60,9 @@
       Parameters</a>
 </h3></div></div></div>
 <p>
- This library also allows to specify default values for the local function
- parameters. However, the usual C++ syntax for default parameters that uses
- the assignment symbol <code class="computeroutput"><span class="special">=</span></code> cannot
- be used. <sup>[<a name="boost_localfunction.Advanced_Topics.default_parameters.f0" href="#ftn.boost_localfunction.Advanced_Topics.default_parameters.f0" class="footnote">17</a>]</sup> The keyword <code class="computeroutput"><span class="keyword">default</span></code>
+ This library allows to specify default values for the local function parameters.
+ However, the usual C++ syntax for default parameters that uses the assignment
+ symbol <code class="computeroutput"><span class="special">=</span></code> cannot be used. <sup>[<a name="boost_localfunction.Advanced_Topics.default_parameters.f0" href="#ftn.boost_localfunction.Advanced_Topics.default_parameters.f0" class="footnote">17</a>]</sup> The keyword <code class="computeroutput"><span class="keyword">default</span></code>
         is used instead:
       </p>
 <pre class="programlisting"><code class="literal"><span class="emphasis"><em>parameter-type parameter-name</em></span></code><span class="special">,</span> <span class="keyword">default</span> <code class="literal"><span class="emphasis"><em>parameter-default-value</em></span></code><span class="special">,</span> <span class="special">...</span>
@@ -75,18 +76,18 @@
       </p>
 <p>
 </p>
-<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">default</span> <span class="number">2</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Default.</span>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">default</span> <span class="number">2</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Default parameter.</span>
     <span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span><span class="special">;</span>
 <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add</span><span class="special">)</span>
 
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">add</span><span class="special">(</span><span class="number">1</span><span class="special">)</span> <span class="special">==</span> <span class="number">3</span> <span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">add</span><span class="special">(</span><span class="number">1</span><span class="special">)</span> <span class="special">==</span> <span class="number">3</span><span class="special">);</span>
 </pre>
 <p>
       </p>
 <p>
         Programmers can define a <code class="computeroutput"><span class="identifier">WITH_DEFAULT</span></code>
         macro similar to the following if they think it improves readability over
- the syntax above (see also add_with_default.cpp):
+ the above syntax (see also add_with_default.cpp):
         <sup>[<a name="boost_localfunction.Advanced_Topics.default_parameters.f1" href="#ftn.boost_localfunction.Advanced_Topics.default_parameters.f1" class="footnote">18</a>]</sup>
       </p>
 <p>
@@ -101,7 +102,7 @@
     <span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span><span class="special">;</span>
 <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add</span><span class="special">)</span>
 
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">add</span><span class="special">(</span><span class="number">1</span><span class="special">)</span> <span class="special">==</span> <span class="number">3</span> <span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">add</span><span class="special">(</span><span class="number">1</span><span class="special">)</span> <span class="special">==</span> <span class="number">3</span><span class="special">);</span>
 </pre>
 <p>
       </p>
@@ -114,7 +115,7 @@
 <p>
         The C++ preprocessor does not allow commas <code class="computeroutput"><span class="special">,</span></code>
         within macro parameters unless they are wrapped by round parenthesis <code class="computeroutput"><span class="special">()</span></code> (see the Boost.Utility/IdentityType
- documentation for details). Therefore, using commas within the local function
+ documentation for details). Therefore, using commas within local function
         parameters and bindings will generate (cryptic) preprocessor errors unless
         they are wrapped with an extra set of round parenthesis <code class="computeroutput"><span class="special">()</span></code>
         as explained here.
@@ -159,9 +160,8 @@
         after the first template parameter <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></code>.
         This comma is not wrapped by any round parenthesis <code class="computeroutput"><span class="special">()</span></code>
         thus it will cause a preprocessor error. <sup>[<a name="boost_localfunction.Advanced_Topics.commas_and_symbols_in_macros.f1" href="#ftn.boost_localfunction.Advanced_Topics.commas_and_symbols_in_macros.f1" class="footnote">20</a>]</sup> The Boost.Utility/IdentityType
- macro <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">(</span></code><code class="literal"><span class="emphasis"><em>parenthesized-type</em></span></code><code class="computeroutput"><span class="special">)</span></code> from the header <code class="literal">boost/utility/identity_type.hpp</code>
- can be used to wrap a type within extra parenthesis <code class="computeroutput"><span class="special">()</span></code>
- so to overcome the problem:
+ macro <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((</span></code><code class="literal"><span class="emphasis"><em>type-with-commas</em></span></code><code class="computeroutput"><span class="special">))</span></code> defined in the <code class="literal">boost/utility/identity_type.hpp</code>
+ header can be used to wrap a type within extra parenthesis <code class="computeroutput"><span class="special">()</span></code> so to overcome this problem:
       </p>
 <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">utility</span><span class="special">/</span><span class="identifier">identity_type</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 
@@ -174,11 +174,12 @@
 </pre>
 <p>
         This macro expands to an expression that evaluates (at compile-time) exactly
- to the specified type. Note that a total of two set of parenthesis <code class="computeroutput"><span class="special">()</span></code> are needed: The parenthesis to invoke the
- <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">(...)</span></code>
- macro plus the parenthesis to wrap the type expression (and therefore any
- comma <code class="computeroutput"><span class="special">,</span></code> that it contains) passed
- as parameter to the <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((...))</span></code> macro. Finally, the <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span></code> macro must be prefixed
+ to the specified type (furthermore, this macro does not use variadic macros
+ so it works on any C++03
+ compiler). Note that a total of two set of parenthesis <code class="computeroutput"><span class="special">()</span></code>
+ are needed: The parenthesis to invoke the <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">(...)</span></code> macro plus the parenthesis to wrap the
+ type expression (and therefore any comma <code class="computeroutput"><span class="special">,</span></code>
+ that it contains) passed as parameter to the <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((...))</span></code> macro. Finally, the <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span></code> macro must be prefixed
         by the <code class="computeroutput"><span class="keyword">typename</span></code> keyword <code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">(</span></code><code class="literal"><span class="emphasis"><em>parenthesized-type</em></span></code><code class="computeroutput"><span class="special">)</span></code> when used together with the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code>
         macro within templates.
       </p>
@@ -207,9 +208,8 @@
 <p>
         <span class="bold"><strong>(2)</strong></span> The parameter type <code class="computeroutput"><span class="special">::</span><span class="identifier">sign_t</span></code> starts with the non-alphanumeric
         symbols <code class="computeroutput"><span class="special">::</span></code> thus it will generate
- preprocessor errors if used as a local function parameter type. The macros
- <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span></code> can also
- be used to overcome this issue:
+ preprocessor errors if used as a local function parameter type. The <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span></code> macro can also be used
+ to overcome this issue:
       </p>
 <pre class="programlisting"><span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
     <span class="special">...</span>
@@ -249,7 +249,7 @@
         first template parameter <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></code>.
         Again, this comma is not wrapped by any parenthesis <code class="computeroutput"><span class="special">()</span></code>
         so it will cause a preprocessor error. Because this is a value expression
- (and not a type expression), it can be simply wrapped within an extra set
+ (and not a type expression), it can simply be wrapped within an extra set
         of round parenthesis <code class="computeroutput"><span class="special">()</span></code>:
       </p>
 <pre class="programlisting"><span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
@@ -285,14 +285,14 @@
 <p>
       </p>
 </div>
-<div class="section boost_localfunction_Advanced_Topics_assigning_and_returning">
+<div class="section boost_localfunction_Advanced_Topics_assignments_and_returns">
 <div class="titlepage"><div><div><h3 class="title">
-<a name="boost_localfunction.Advanced_Topics.assigning_and_returning"></a><a class="link" href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.assigning_and_returning" title="Assigning and Returning">Assigning
- and Returning</a>
+<a name="boost_localfunction.Advanced_Topics.assignments_and_returns"></a><a class="link" href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.assignments_and_returns" title="Assignments and Returns">Assignments
+ and Returns</a>
 </h3></div></div></div>
 <p>
         Local functions are function objects so it is possible to assign them to
- other functors like Boost.Function
+ other functors like Boost.Function's
         <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span></code> in order to store the local function
         into a variable, pass it as a parameter to another function, or return it
         from the enclosing function.
@@ -302,8 +302,8 @@
       </p>
 <p>
 </p>
-<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">call1</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">&gt;</span> <span class="identifier">f</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">f</span><span class="special">(</span><span class="number">1</span><span class="special">)</span> <span class="special">==</span> <span class="number">5</span> <span class="special">);</span> <span class="special">}</span>
-<span class="keyword">void</span> <span class="identifier">call0</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)&gt;</span> <span class="identifier">f</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">f</span><span class="special">()</span> <span class="special">==</span> <span class="number">5</span> <span class="special">);</span> <span class="special">}</span>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">call1</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">&gt;</span> <span class="identifier">f</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">f</span><span class="special">(</span><span class="number">1</span><span class="special">)</span> <span class="special">==</span> <span class="number">5</span><span class="special">);</span> <span class="special">}</span>
+<span class="keyword">void</span> <span class="identifier">call0</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)&gt;</span> <span class="identifier">f</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">f</span><span class="special">()</span> <span class="special">==</span> <span class="number">5</span><span class="special">);</span> <span class="special">}</span>
 
 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="special">(</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">)&gt;</span> <span class="identifier">linear</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">slope</span><span class="special">)</span> <span class="special">{</span>
     <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">slope</span><span class="special">,</span>
@@ -312,7 +312,7 @@
     <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">lin</span><span class="special">)</span>
 
     <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="special">(</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">)&gt;</span> <span class="identifier">f</span> <span class="special">=</span> <span class="identifier">lin</span><span class="special">;</span> <span class="comment">// Assign to local variable.</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">f</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">)</span> <span class="special">==</span> <span class="number">5</span> <span class="special">);</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">f</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">)</span> <span class="special">==</span> <span class="number">5</span><span class="special">);</span>
 
     <span class="identifier">call1</span><span class="special">(</span><span class="identifier">lin</span><span class="special">);</span> <span class="comment">// Pass to other functions.</span>
     <span class="identifier">call0</span><span class="special">(</span><span class="identifier">lin</span><span class="special">);</span>
@@ -322,29 +322,30 @@
 
 <span class="keyword">void</span> <span class="identifier">call</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
     <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="special">(</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">)&gt;</span> <span class="identifier">f</span> <span class="special">=</span> <span class="identifier">linear</span><span class="special">(</span><span class="number">2</span><span class="special">);</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">f</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">)</span> <span class="special">==</span> <span class="number">5</span> <span class="special">);</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">f</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">)</span> <span class="special">==</span> <span class="number">5</span><span class="special">);</span>
 <span class="special">}</span>
 </pre>
 <p>
       </p>
-<p>
- Note that:
- </p>
-<div class="important"><table border="0" summary="Important">
+<div class="warning"><table border="0" summary="Warning">
 <tr>
-<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td>
-<th align="left">Important</th>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../../../doc/src/images/warning.png"></td>
+<th align="left">Warning</th>
 </tr>
 <tr><td align="left" valign="top"><p>
           As with <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions, programmers are responsible to ensure that bound
- references are valid in any scope where the local function object is called.
- (This might be tricky to verify in a program when local functions are returned
- and called outside the local scope of their declaration.)
+ lambda functions</a>, programmers are responsible to ensure that bound
+ variables are valid in any scope where the local function object is called.
+ Returning and calling a local function outside its declaration scope will
+ lead to undefined behaviour if any of the bound variable is no longer valid
+ in the scope where the local function is called (see the <a class="link" href="Examples.html" title="Examples">Examples</a>
+ section for more examples on the extra care needed when returning a local
+ function as a closure). It is always safe instead to call a local function
+ within its enclosing scope.
         </p></td></tr>
 </table></div>
 <p>
- In addition, a local function can bind and call another local function. Local
+ In addition, a local function can bind and call other local functions. Local
         functions should always be bound by constant reference <code class="computeroutput"><span class="keyword">const</span>
         <span class="identifier">bind</span><span class="special">&amp;</span></code>
         to avoid unnecessary copies. For example, the following local function <code class="computeroutput"><span class="identifier">inc_sum</span></code> binds the local function <code class="computeroutput"><span class="identifier">inc</span></code> so <code class="computeroutput"><span class="identifier">inc_sum</span></code>
@@ -357,7 +358,7 @@
 <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">w</span><span class="special">;</span>
 
 <span class="keyword">for</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">1</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;=</span> <span class="number">2</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">i</span> <span class="special">*</span> <span class="number">10</span><span class="special">);</span>
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">v</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">==</span> <span class="number">10</span> <span class="special">);</span> <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">v</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">==</span> <span class="number">20</span> <span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">v</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">==</span> <span class="number">10</span><span class="special">);</span> <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">v</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">==</span> <span class="number">20</span><span class="special">);</span>
 <span class="identifier">w</span><span class="special">.</span><span class="identifier">resize</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">size</span><span class="special">());</span>
 
 <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">offset</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">i</span><span class="special">)</span> <span class="special">{</span>
@@ -365,7 +366,7 @@
 <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">inc</span><span class="special">)</span>
 
 <span class="identifier">std</span><span class="special">::</span><span class="identifier">transform</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">w</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">inc</span><span class="special">);</span>
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">w</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">==</span> <span class="number">16</span> <span class="special">);</span> <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">w</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">==</span> <span class="number">26</span> <span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">w</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">==</span> <span class="number">16</span><span class="special">);</span> <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">w</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">==</span> <span class="number">26</span><span class="special">);</span>
 
 <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">inc</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">i</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">j</span><span class="special">)</span> <span class="special">{</span>
     <span class="keyword">return</span> <span class="identifier">inc</span><span class="special">(</span><span class="identifier">i</span> <span class="special">+</span> <span class="identifier">j</span><span class="special">);</span> <span class="comment">// Call the other bound local function.</span>
@@ -373,7 +374,7 @@
 
 <span class="identifier">offset</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
 <span class="identifier">std</span><span class="special">::</span><span class="identifier">transform</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">w</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">inc_sum</span><span class="special">);</span>
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">v</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">==</span> <span class="number">27</span> <span class="special">);</span> <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">v</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">==</span> <span class="number">47</span> <span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">v</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">==</span> <span class="number">27</span><span class="special">);</span> <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">v</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">==</span> <span class="number">47</span><span class="special">);</span>
 </pre>
 <p>
       </p>
@@ -410,9 +411,12 @@
       Types (concepts, etc)</a>
 </h3></div></div></div>
 <p>
- This library never requires to explicitly specify the type of bound variables.
- From within local functions, programmers can access the type of a bound variable
- using the following macro:
+ This library never requires to explicitly specify the type of bound variables
+ (e.g., this reduces maintenance because the local function declaration and
+ definition do not have to change even if the bound variable types change
+ as long as the semantics of the local function remain valid). From within
+ local functions, programmers can access the type of a bound variable using
+ the following macro:
       </p>
 <pre class="programlisting"><span class="identifier">BOOST_LOCAL_FUNCTION_TYPEOF</span><span class="special">(</span><span class="emphasis"><em>bound-variable-name</em></span><span class="special">)</span>
 </pre>
@@ -440,10 +444,10 @@
 <pre class="programlisting"><span class="keyword">int</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
 
 <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">factor</span><span class="special">,</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span>
- <span class="comment">// Typeof for concept checking.</span>
+ <span class="comment">// Type-of for concept checking.</span>
     <span class="identifier">BOOST_CONCEPT_ASSERT</span><span class="special">((</span><span class="identifier">Addable</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_reference</span><span class="special">&lt;</span>
             <span class="identifier">BOOST_LOCAL_FUNCTION_TYPEOF</span><span class="special">(</span><span class="identifier">sum</span><span class="special">)&gt;::</span><span class="identifier">type</span><span class="special">&gt;));</span>
- <span class="comment">// Typeof for declarations.</span>
+ <span class="comment">// Type-of for declarations.</span>
     <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_reference</span><span class="special">&lt;</span><span class="identifier">BOOST_LOCAL_FUNCTION_TYPEOF</span><span class="special">(</span>
             <span class="identifier">factor</span><span class="special">)&gt;::</span><span class="identifier">type</span> <span class="identifier">mult</span> <span class="special">=</span> <span class="identifier">factor</span> <span class="special">*</span> <span class="identifier">num</span><span class="special">;</span>
     <span class="identifier">sum</span> <span class="special">+=</span> <span class="identifier">mult</span><span class="special">;</span>
@@ -471,7 +475,7 @@
         <span class="identifier">BOOST_CONCEPT_ASSERT</span><span class="special">((</span><span class="identifier">Addable</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_reference</span><span class="special">&lt;</span>
                 <span class="identifier">BOOST_LOCAL_FUNCTION_TYPEOF</span><span class="special">(</span><span class="identifier">sum</span><span class="special">)&gt;::</span><span class="identifier">type</span><span class="special">&gt;));</span>
         <span class="identifier">sum</span> <span class="special">+=</span> <span class="identifier">factor</span> <span class="special">*</span> <span class="identifier">num</span><span class="special">;</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add</span><span class="special">)</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME_TPL</span><span class="special">(</span><span class="identifier">add</span><span class="special">)</span>
 
     <span class="identifier">add</span><span class="special">(</span><span class="number">6</span><span class="special">);</span>
     <span class="keyword">return</span> <span class="identifier">sum</span><span class="special">;</span>
@@ -480,23 +484,15 @@
 <p>
       </p>
 <p>
- It is best to use the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_TYPEOF.html" title="Macro BOOST_LOCAL_FUNCTION_TYPEOF">BOOST_LOCAL_FUNCTION_TYPEOF</a></code>
+ In this context, it is best to use the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_TYPEOF.html" title="Macro BOOST_LOCAL_FUNCTION_TYPEOF">BOOST_LOCAL_FUNCTION_TYPEOF</a></code>
         macro instead of using Boost.Typeof
- so to reduce the number of times that Boost.Typeof
- is invoked:
+ to reduce the number of times that Boost.Typeof
+ is invoked (either the library already internally used Boost.Typeof
+ once, in which case using this macro will not use Boost.Typeof
+ again, or the bound variable type is explicitly specified by programmers
+ as shown be below, in which case using this macro will not use Boost.Typeof
+ at all).
       </p>
-<div class="orderedlist"><ol class="orderedlist" type="1">
-<li class="listitem">
- Either the library already internally used Boost.Typeof
- once, in which case using this macro will not use Boost.Typeof
- again.
- </li>
-<li class="listitem">
- Or, the bound variable type is explicitly specified by programmers (see
- below), in which case using this macro will not use Boost.Typeof
- at all.
- </li>
-</ol></div>
 <p>
         Furthermore, within the local function body it possible to access the result
         type using <code class="computeroutput"><span class="identifier">result_type</span></code>, the
@@ -505,15 +501,15 @@
         etc. <sup>[<a name="boost_localfunction.Advanced_Topics.accessing_types__concepts__etc_.f0" href="#ftn.boost_localfunction.Advanced_Topics.accessing_types__concepts__etc_.f0" class="footnote">21</a>]</sup>
       </p>
 </div>
-<div class="section boost_localfunction_Advanced_Topics_specifying_types">
+<div class="section boost_localfunction_Advanced_Topics_specifying_types__no_boost_typeof_">
 <div class="titlepage"><div><div><h3 class="title">
-<a name="boost_localfunction.Advanced_Topics.specifying_types"></a><a class="link" href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.specifying_types" title="Specifying Types">Specifying
- Types</a>
+<a name="boost_localfunction.Advanced_Topics.specifying_types__no_boost_typeof_"></a><a class="link" href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.specifying_types__no_boost_typeof_" title="Specifying Types (no Boost.Typeof)">Specifying
+ Types (no Boost.Typeof)</a>
 </h3></div></div></div>
 <p>
- While not required, it is possible to explicitly specify the type of a bound
- variable so the library will not internally use Boost.Typeof
- to automatically deduce such a type. When specified, the bound variable type
+ While not required, it is possible to explicitly specify the type of bound
+ variables so the library will not internally use Boost.Typeof
+ to automatically deduce the types. When specified, the bound variable type
         must follow the <code class="computeroutput"><span class="identifier">bind</span></code> "keyword"
         and it must be wrapped within round parenthesis <code class="computeroutput"><span class="special">()</span></code>:
       </p>
@@ -546,23 +542,23 @@
         Note that the result type must be specified only once either before the macro
         (without the <code class="computeroutput"><span class="keyword">return</span></code> prefix)
         or as one of the macro parameters (with the <code class="computeroutput"><span class="keyword">return</span></code>
- prefix). As usual, the result type can always be <code class="computeroutput"><span class="keyword">void</span></code>
- to declare a function returning nothing (so <code class="computeroutput"><span class="keyword">return</span>
+ prefix). As always, the result type can be <code class="computeroutput"><span class="keyword">void</span></code>
+ to declare a function that returns nothing (so <code class="computeroutput"><span class="keyword">return</span>
         <span class="keyword">void</span></code> is allowed when the result type
         is specified as one of the macro parameters).
       </p>
 <p>
         The following example specifies all bound variables and result types (see
         also add_typed.cpp):
- <sup>[<a name="boost_localfunction.Advanced_Topics.specifying_types.f0" href="#ftn.boost_localfunction.Advanced_Topics.specifying_types.f0" class="footnote">22</a>]</sup>
+ <sup>[<a name="boost_localfunction.Advanced_Topics.specifying_types__no_boost_typeof_.f0" href="#ftn.boost_localfunction.Advanced_Topics.specifying_types__no_boost_typeof_.f0" class="footnote">22</a>]</sup>
       </p>
 <p>
 </p>
 <pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">adder</span> <span class="special">{</span>
- <span class="identifier">adder</span><span class="special">():</span> <span class="identifier">sum_</span><span class="special">(</span><span class="number">0</span><span class="special">)</span> <span class="special">{}</span>
+ <span class="identifier">adder</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">sum_</span><span class="special">(</span><span class="number">0</span><span class="special">)</span> <span class="special">{}</span>
 
     <span class="keyword">int</span> <span class="identifier">sum</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;&amp;</span> <span class="identifier">nums</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">)</span> <span class="special">{</span>
- <span class="comment">// Explicitly specify bound variable and result types.</span>
+ <span class="comment">// Explicitly specify bound variable and return types (no type-of).</span>
         <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;)</span> <span class="identifier">factor</span><span class="special">,</span>
                 <span class="identifier">bind</span><span class="special">(</span><span class="identifier">adder</span><span class="special">*)</span> <span class="identifier">this_</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">num</span><span class="special">,</span> <span class="keyword">return</span> <span class="keyword">int</span><span class="special">)</span> <span class="special">{</span>
             <span class="keyword">return</span> <span class="identifier">this_</span><span class="special">-&gt;</span><span class="identifier">sum_</span> <span class="special">+=</span> <span class="identifier">factor</span> <span class="special">*</span> <span class="identifier">num</span><span class="special">;</span>
@@ -571,6 +567,7 @@
         <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">nums</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">add</span><span class="special">);</span>
         <span class="keyword">return</span> <span class="identifier">sum_</span><span class="special">;</span>
     <span class="special">}</span>
+
 <span class="keyword">private</span><span class="special">:</span>
     <span class="keyword">int</span> <span class="identifier">sum_</span><span class="special">;</span>
 <span class="special">};</span>
@@ -581,7 +578,7 @@
         Unless necessary, it is recommended to not specify the bound variable and
         result types. Let the library deduce these types so the local function syntax
         will be more concise and the local function declaration will not have to
- change if a bound variable type changes (facilitating maintenance).
+ change if a bound variable type changes (reducing maintenance).
       </p>
 <div class="note"><table border="0" summary="Note">
 <tr>
@@ -589,10 +586,8 @@
 <th align="left">Note</th>
 </tr>
 <tr><td align="left" valign="top"><p>
- Unfortunately, even when all bound variables and result types are explicitly
- specified, the currently library implementation still has to use Boost.Typeof once (to deduce
- the local function object type, see the <a class="link" href="Implementation.html" title="Annex: Implementation">Implementation</a>
- section).
+ When all bound variable and result types are explicitly specified, the
+ library implementation will not use Boost.Typeof.
         </p></td></tr>
 </table></div>
 </div>
@@ -601,10 +596,10 @@
 <a name="boost_localfunction.Advanced_Topics.inlining"></a><a class="link" href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.inlining" title="Inlining">Inlining</a>
 </h3></div></div></div>
 <p>
- Local functions can be declared inline to increase the chances that the compiler
- will be able to reduce the run-time of the local function call by inlining
- the generated assembly code. A local function is declared inline by prefixing
- its name with the keyword <code class="computeroutput"><span class="keyword">inline</span></code>:
+ Local functions can be declared inline
+ to increase the chances that the compiler will be able to reduce the run-time
+ of the local function call by inlining the generated assembly code. A local
+ function is declared inline by prefixing its name with the keyword <code class="computeroutput"><span class="keyword">inline</span></code>:
       </p>
 <pre class="programlisting"><span class="emphasis"><em>result-type</em></span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="emphasis"><em>parameters</em></span><span class="special">)</span> <span class="special">{</span>
     <span class="special">...</span> <span class="comment">// Body.</span>
@@ -616,10 +611,10 @@
 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
 <li class="listitem">
             On C++03
- compliant compilers, inlined local functions always have a run-time comparable
+ compliant compilers, inline local functions always have a run-time comparable
             to their equivalent implementation that uses local functors (see the
             <a class="link" href="Alternatives.html" title="Annex: Alternatives">Alternatives</a>
- section). However, inlined local functions have the important limitation
+ section). However, inline local functions have the important limitation
             that they cannot be assigned to other functors (like <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span></code>)
             and they cannot be passed as template parameters.
           </li>
@@ -660,7 +655,7 @@
 
 <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">factor</span><span class="special">,</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span>
     <span class="identifier">sum</span> <span class="special">+=</span> <span class="identifier">factor</span> <span class="special">*</span> <span class="identifier">num</span><span class="special">;</span>
-<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="keyword">inline</span> <span class="identifier">add</span><span class="special">)</span> <span class="comment">// Inlined.</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="keyword">inline</span> <span class="identifier">add</span><span class="special">)</span> <span class="comment">// Inlining.</span>
 
 <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">v</span><span class="special">(</span><span class="number">100</span><span class="special">);</span>
 <span class="identifier">std</span><span class="special">::</span><span class="identifier">fill</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="number">1</span><span class="special">);</span>
@@ -678,7 +673,7 @@
         Local functions can be declared recursive
         so a local function can recursively call itself from its body (as usual with
         C++ functions). A local function is declared recursive by prefixing its name
- with the "keyword" <code class="computeroutput"><span class="identifier">recursive</span></code>
+ with the <code class="computeroutput"><span class="identifier">recursive</span></code> "keyword"
         (thus <code class="computeroutput"><span class="identifier">recursive</span></code> cannot be
         used as a local function name):
       </p>
@@ -715,9 +710,13 @@
       </p>
 <p>
         Compilers have not been observed to be able to inline recursive local function
- calls (not even when the recursive local function is also declared inline
- as in <code class="computeroutput"><span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="keyword">inline</span> <span class="identifier">recursive</span>
- <span class="identifier">factorial</span><span class="special">)</span></code>).
+ calls not even when the recursive local function is also declared inline:
+ </p>
+<pre class="programlisting"><span class="special">...</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="keyword">inline</span> <span class="identifier">recursive</span> <span class="identifier">factorial</span><span class="special">)</span>
+</pre>
+<p>
+ Recursive local functions should never be called outside their declaration
+ scope. <sup>[<a name="boost_localfunction.Advanced_Topics.recursion.f0" href="#ftn.boost_localfunction.Advanced_Topics.recursion.f0" class="footnote">24</a>]</sup>
       </p>
 <div class="warning"><table border="0" summary="Warning">
 <tr>
@@ -725,25 +724,27 @@
 <th align="left">Warning</th>
 </tr>
 <tr><td align="left" valign="top"><p>
- Recursive local functions should never be called outside their declaration
- scope. If a local function is returned from the enclosing function and
- called in a different scope, the behaviour is undefined (and it will likely
- result in a run-time error). <sup>[<a name="boost_localfunction.Advanced_Topics.recursion.f0" href="#ftn.boost_localfunction.Advanced_Topics.recursion.f0" class="footnote">24</a>]</sup> This is not a limitation with respect to <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions because lambdas can never call themselves recursively
- (in other words, there is no recursive lambda function that can successfully
- be called outside its declaration scope because there is no recursive lambda
- function at all).
+ If a local function is returned from the enclosing function and called
+ in a different scope, the behaviour is undefined (and it will likely result
+ in a run-time error).
         </p></td></tr>
 </table></div>
+<p>
+ This is not a limitation with respect to <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a> because lambdas can never call themselves recursively
+ (in other words, there is no recursive lambda function that can successfully
+ be called outside its declaration scope because there is no recursive lambda
+ function at all).
+ </p>
 </div>
 <div class="section boost_localfunction_Advanced_Topics_overloading">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_localfunction.Advanced_Topics.overloading"></a><a class="link" href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.overloading" title="Overloading">Overloading</a>
 </h3></div></div></div>
 <p>
- It is possible to overload local functions using the <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">overloaded_function</span></code>
- functor of Boost.Functional/OverloadedFunction
- from the header <code class="literal">boost/functional/overloaded_function.hpp</code>
+ Because local functions are functors, it is possible to overload them using
+ the <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">overloaded_function</span></code> functor of Boost.Functional/OverloadedFunction
+ from the <code class="literal">boost/functional/overloaded_function.hpp</code> header
         (see the Boost.Functional/OverloadedFunction
         documentation for details).
       </p>
@@ -756,31 +757,33 @@
 <p>
 </p>
 <pre class="programlisting"><span class="keyword">int</span> <span class="identifier">add_i</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span><span class="special">;</span> <span class="special">}</span>
-
-<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test_overload</span> <span class="special">)</span> <span class="special">{</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">s</span> <span class="special">=</span> <span class="string">"abc"</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
- <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">s</span> <span class="special">+</span> <span class="identifier">x</span><span class="special">;</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add_s</span><span class="special">)</span>
-
- <span class="keyword">double</span> <span class="identifier">d</span> <span class="special">=</span> <span class="number">1.23</span><span class="special">;</span>
- <span class="keyword">double</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">default</span> <span class="number">0</span><span class="special">)</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">d</span> <span class="special">+</span> <span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span><span class="special">;</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add_d</span><span class="special">)</span>
-
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">overloaded_function</span><span class="special">&lt;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;)</span>
- <span class="special">,</span> <span class="keyword">double</span> <span class="special">(</span><span class="keyword">double</span><span class="special">)</span>
- <span class="special">,</span> <span class="keyword">double</span> <span class="special">(</span><span class="keyword">double</span><span class="special">,</span> <span class="keyword">double</span><span class="special">)</span> <span class="comment">// Overload giving default param.</span>
- <span class="special">,</span> <span class="keyword">int</span> <span class="special">(</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">)</span>
- <span class="special">&gt;</span> <span class="identifier">add</span><span class="special">(</span><span class="identifier">add_s</span><span class="special">,</span> <span class="identifier">add_d</span><span class="special">,</span> <span class="identifier">add_d</span><span class="special">,</span> <span class="identifier">add_i</span><span class="special">);</span> <span class="comment">// Overloaded function object.</span>
-
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">add</span><span class="special">(</span><span class="string">"xyz"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abcxyz"</span> <span class="special">);</span> <span class="comment">// Call `add_s`.</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">fabs</span><span class="special">(</span><span class="identifier">add</span><span class="special">(</span><span class="number">3.21</span><span class="special">)</span> <span class="special">-</span> <span class="number">4.44</span><span class="special">)</span> <span class="special">&lt;</span> <span class="number">0.001</span> <span class="special">);</span> <span class="comment">// Call `add_d` (no default).</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">fabs</span><span class="special">(</span><span class="identifier">add</span><span class="special">(</span><span class="number">3.21</span><span class="special">,</span> <span class="number">40.0</span><span class="special">)</span> <span class="special">-</span> <span class="number">44.44</span><span class="special">)</span> <span class="special">&lt;</span> <span class="number">0.001</span><span class="special">);</span> <span class="comment">// Call `add_d`.</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">add</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">)</span> <span class="special">==</span> <span class="number">3</span> <span class="special">);</span> <span class="comment">// Call `add_i`.</span>
-<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">s</span> <span class="special">=</span> <span class="string">"abc"</span><span class="special">;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">s</span> <span class="special">+</span> <span class="identifier">x</span><span class="special">;</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add_s</span><span class="special">)</span>
+
+<span class="keyword">double</span> <span class="identifier">d</span> <span class="special">=</span> <span class="number">1.23</span><span class="special">;</span>
+<span class="keyword">double</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">default</span> <span class="number">0</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">d</span> <span class="special">+</span> <span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span><span class="special">;</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add_d</span><span class="special">)</span>
+
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">overloaded_function</span><span class="special">&lt;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;)</span>
+ <span class="special">,</span> <span class="keyword">double</span> <span class="special">(</span><span class="keyword">double</span><span class="special">)</span>
+ <span class="special">,</span> <span class="keyword">double</span> <span class="special">(</span><span class="keyword">double</span><span class="special">,</span> <span class="keyword">double</span><span class="special">)</span> <span class="comment">// Overload giving default param.</span>
+ <span class="special">,</span> <span class="keyword">int</span> <span class="special">(</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">)</span>
+<span class="special">&gt;</span> <span class="identifier">add</span><span class="special">(</span><span class="identifier">add_s</span><span class="special">,</span> <span class="identifier">add_d</span><span class="special">,</span> <span class="identifier">add_d</span><span class="special">,</span> <span class="identifier">add_i</span><span class="special">);</span> <span class="comment">// Overloaded function object.</span>
+
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">add</span><span class="special">(</span><span class="string">"xyz"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abcxyz"</span><span class="special">);</span> <span class="comment">// Call `add_s`.</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">fabs</span><span class="special">(</span><span class="identifier">add</span><span class="special">(</span><span class="number">3.21</span><span class="special">)</span> <span class="special">-</span> <span class="number">4.44</span><span class="special">)</span> <span class="special">&lt;</span> <span class="number">0.001</span><span class="special">);</span> <span class="comment">// Call `add_d` (no default).</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">fabs</span><span class="special">(</span><span class="identifier">add</span><span class="special">(</span><span class="number">3.21</span><span class="special">,</span> <span class="number">40.0</span><span class="special">)</span> <span class="special">-</span> <span class="number">44.44</span><span class="special">)</span> <span class="special">&lt;</span> <span class="number">0.001</span><span class="special">);</span> <span class="comment">// Call `add_d`.</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">add</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">)</span> <span class="special">==</span> <span class="number">3</span><span class="special">);</span> <span class="comment">// Call `add_i`.</span>
 </pre>
 <p>
       </p>
@@ -828,15 +831,15 @@
 <p>
       </p>
 </div>
-<div class="section boost_localfunction_Advanced_Topics_storage_classifiers___auto__and__register__">
+<div class="section boost_localfunction_Advanced_Topics_storage_classifiers">
 <div class="titlepage"><div><div><h3 class="title">
-<a name="boost_localfunction.Advanced_Topics.storage_classifiers___auto__and__register__"></a><a class="link" href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.storage_classifiers___auto__and__register__" title="Storage Classifiers (auto and register)">Storage
- Classifiers (<code class="computeroutput"><span class="keyword">auto</span></code> and <code class="computeroutput"><span class="keyword">register</span></code>)</a>
+<a name="boost_localfunction.Advanced_Topics.storage_classifiers"></a><a class="link" href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.storage_classifiers" title="Storage Classifiers">Storage
+ Classifiers</a>
 </h3></div></div></div>
 <p>
         Local function parameters support the storage classifiers as usual in C++03.
         The <code class="computeroutput"><span class="keyword">auto</span></code> storage classifier
- is specified as: <sup>[<a name="boost_localfunction.Advanced_Topics.storage_classifiers___auto__and__register__.f0" href="#ftn.boost_localfunction.Advanced_Topics.storage_classifiers___auto__and__register__.f0" class="footnote">25</a>]</sup>
+ is specified as: <sup>[<a name="boost_localfunction.Advanced_Topics.storage_classifiers.f0" href="#ftn.boost_localfunction.Advanced_Topics.storage_classifiers.f0" class="footnote">25</a>]</sup>
       </p>
 <pre class="programlisting"><span class="keyword">auto</span> <span class="emphasis"><em>parameter-type parameter-name</em></span>
 </pre>
@@ -858,6 +861,86 @@
 <p>
       </p>
 </div>
+<div class="section boost_localfunction_Advanced_Topics_same_line_expansions">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_localfunction.Advanced_Topics.same_line_expansions"></a><a class="link" href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.same_line_expansions" title="Same Line Expansions">Same
+ Line Expansions</a>
+</h3></div></div></div>
+<p>
+ In general, it is not possible to expand the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>,
+ <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code>
+ macros multiple times on the same line. <sup>[<a name="boost_localfunction.Advanced_Topics.same_line_expansions.f0" href="#ftn.boost_localfunction.Advanced_Topics.same_line_expansions.f0" class="footnote">26</a>]</sup>
+ </p>
+<p>
+ Therefore, this library provides additional macros <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_ID.html" title="Macro BOOST_LOCAL_FUNCTION_ID">BOOST_LOCAL_FUNCTION_ID</a></code>
+ and <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_TPL_ID.html" title="Macro BOOST_LOCAL_FUNCTION_TPL_ID">BOOST_LOCAL_FUNCTION_TPL_ID</a></code>
+ which can be expanded multiple times on the same line as long as programmers
+ specify unique identifiers as the macros' first parameters. The unique identifier
+ can be any token (not just numeric) that can be successfully concatenated
+ by the preprocessor (e.g., <code class="computeroutput"><span class="identifier">local_function_number_1_at_line_123</span></code>).
+ <sup>[<a name="boost_localfunction.Advanced_Topics.same_line_expansions.f1" href="#ftn.boost_localfunction.Advanced_Topics.same_line_expansions.f1" class="footnote">27</a>]</sup>
+ </p>
+<p>
+ The <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_ID.html" title="Macro BOOST_LOCAL_FUNCTION_ID">BOOST_LOCAL_FUNCTION_ID</a></code>
+ and <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_TPL_ID.html" title="Macro BOOST_LOCAL_FUNCTION_TPL_ID">BOOST_LOCAL_FUNCTION_TPL_ID</a></code>
+ macros accept local function parameter declaration lists using the exact
+ same syntax as <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>.
+ For example (see also same_line.cpp):
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">LOCAL_INC_DEC</span><span class="special">(</span><span class="identifier">offset</span><span class="special">)</span> <span class="special">\</span>
+ <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION_ID</span><span class="special">(</span><span class="identifier">BOOST_PP_CAT</span><span class="special">(</span><span class="identifier">inc</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">),</span> <span class="comment">/* unique ID */</span> <span class="special">\</span>
+ <span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">offset</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="special">\</span>
+ <span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+</span> <span class="identifier">offset</span><span class="special">;</span> <span class="special">\</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">inc</span><span class="special">)</span> <span class="special">\</span>
+ <span class="special">\</span>
+ <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION_ID</span><span class="special">(</span><span class="identifier">BOOST_PP_CAT</span><span class="special">(</span><span class="identifier">dec</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">),</span> <span class="special">\</span>
+ <span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">offset</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="special">\</span>
+ <span class="keyword">return</span> <span class="identifier">x</span> <span class="special">-</span> <span class="identifier">offset</span><span class="special">;</span> <span class="special">\</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">dec</span><span class="special">)</span>
+
+<span class="preprocessor">#define</span> <span class="identifier">LOCAL_INC_DEC_TPL</span><span class="special">(</span><span class="identifier">offset</span><span class="special">)</span> <span class="special">\</span>
+ <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION_TPL_ID</span><span class="special">(</span><span class="identifier">BOOST_PP_CAT</span><span class="special">(</span><span class="identifier">inc</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">),</span> <span class="special">\</span>
+ <span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">offset</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="special">\</span>
+ <span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+</span> <span class="identifier">offset</span><span class="special">;</span> <span class="special">\</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">inc</span><span class="special">)</span> <span class="special">\</span>
+ <span class="special">\</span>
+ <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION_TPL_ID</span><span class="special">(</span><span class="identifier">BOOST_PP_CAT</span><span class="special">(</span><span class="identifier">dec</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">),</span> <span class="special">\</span>
+ <span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">offset</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="special">\</span>
+ <span class="keyword">return</span> <span class="identifier">x</span> <span class="special">-</span> <span class="identifier">offset</span><span class="special">;</span> <span class="special">\</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">dec</span><span class="special">)</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">delta</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">LOCAL_INC_DEC_TPL</span><span class="special">(</span><span class="identifier">delta</span><span class="special">)</span> <span class="comment">// Multiple local functions on same line.</span>
+ <span class="comment">/** @todo back to BOOST_TEST(dec(inc(123)) == 123)) and doc that on vacpp compiler composition doesn't work */</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">inc</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span> <span class="special">+</span> <span class="identifier">delta</span><span class="special">);</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">dec</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span> <span class="special">-</span> <span class="identifier">delta</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">int</span> <span class="identifier">delta</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
+
+ <span class="identifier">LOCAL_INC_DEC</span><span class="special">(</span><span class="identifier">delta</span><span class="special">)</span> <span class="comment">// Multiple local functions on same line.</span>
+ <span class="comment">/** @todo back to BOOST_TEST(dec(inc(123)) == 123)) and doc that on vacpp compiler composition doesn't work */</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">inc</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span> <span class="special">+</span> <span class="identifier">delta</span><span class="special">);</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">dec</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span> <span class="special">-</span> <span class="identifier">delta</span><span class="special">);</span>
+
+ <span class="identifier">f</span><span class="special">(</span><span class="identifier">delta</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ As shown by the example above, the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_ID.html" title="Macro BOOST_LOCAL_FUNCTION_ID">BOOST_LOCAL_FUNCTION_ID</a></code>
+ and <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_TPL_ID.html" title="Macro BOOST_LOCAL_FUNCTION_TPL_ID">BOOST_LOCAL_FUNCTION_TPL_ID</a></code>
+ macros are especially useful when it is necessary to invoke them multiple
+ times within a user-defined macro (because the preprocessor expands all nested
+ macros on the same line).
+ </p>
+</div>
 <div class="section boost_localfunction_Advanced_Topics_limitations__operators__etc_">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_localfunction.Advanced_Topics.limitations__operators__etc_"></a><a class="link" href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.limitations__operators__etc_" title="Limitations (operators, etc)">Limitations
@@ -899,7 +982,7 @@
               </td>
 <td>
                 <p>
- No
+ No.
                 </p>
               </td>
 <td>
@@ -918,7 +1001,7 @@
               </td>
 <td>
                 <p>
- No
+ No.
                 </p>
               </td>
 <td>
@@ -937,7 +1020,7 @@
               </td>
 <td>
                 <p>
- No
+ No.
                 </p>
               </td>
 <td>
@@ -954,17 +1037,16 @@
               </td>
 <td>
                 <p>
- Yes
+ Yes.
                 </p>
               </td>
 <td>
                 <p>
                   Local functions can be specified <code class="computeroutput"><span class="keyword">inline</span></code>
                   to improve the chances that C++03
- standard compilers can optimize the local function call run-time
- (but <code class="computeroutput"><span class="keyword">inline</span></code> local
- functions cannot be passed as template parameters on C++03
- standard compilers, see the <a class="link" href="Advanced_Topics.html" title="Advanced Topics">Advanced
+ compilers can optimize the local function call run-time (but <code class="computeroutput"><span class="keyword">inline</span></code> local functions cannot be
+ passed as template parameters on C++03
+ compilers, see the <a class="link" href="Advanced_Topics.html" title="Advanced Topics">Advanced
                   Topics</a> section).
                 </p>
               </td>
@@ -977,7 +1059,7 @@
               </td>
 <td>
                 <p>
- No
+ No.
                 </p>
               </td>
 <td>
@@ -995,7 +1077,7 @@
               </td>
 <td>
                 <p>
- No
+ No.
                 </p>
               </td>
 <td>
@@ -1012,7 +1094,7 @@
               </td>
 <td>
                 <p>
- No
+ No.
                 </p>
               </td>
 <td>
@@ -1030,7 +1112,7 @@
               </td>
 <td>
                 <p>
- Yes
+ Yes.
                 </p>
               </td>
 <td>
@@ -1048,7 +1130,7 @@
               </td>
 <td>
                 <p>
- Yes
+ Yes.
                 </p>
               </td>
 <td>
@@ -1068,7 +1150,7 @@
               </td>
 <td>
                 <p>
- Yes
+ Yes.
                 </p>
               </td>
 <td>
@@ -1090,7 +1172,7 @@
               </td>
 <td>
                 <p>
- No
+ No.
                 </p>
               </td>
 <td>
@@ -1108,7 +1190,7 @@
               </td>
 <td>
                 <p>
- No
+ No.
                 </p>
               </td>
 <td>
@@ -1125,7 +1207,7 @@
                     because it seemed of <a href="http://lists.boost.org/Archives/boost/2010/09/170895.php" target="_top">no
                     use</a> given that local functions can be bound to one another
                     thus they can simply call each other directly without recurring
- to dynamic binding or base function call.
+ to dynamic binding or base function calls.
                   </p></div></td></tr></tbody>
 </table></div>
 <h6>
@@ -1134,27 +1216,16 @@
       </h6>
 <p>
         Local functions cannot be operators. Naming a local function <code class="computeroutput"><span class="keyword">operator</span><span class="special">...</span></code>
- will generate a compile-time error. <sup>[<a name="boost_localfunction.Advanced_Topics.limitations__operators__etc_.f1" href="#ftn.boost_localfunction.Advanced_Topics.limitations__operators__etc_.f1" class="footnote">26</a>]</sup>
+ will generate a compile-time error. <sup>[<a name="boost_localfunction.Advanced_Topics.limitations__operators__etc_.f1" href="#ftn.boost_localfunction.Advanced_Topics.limitations__operators__etc_.f1" class="footnote">28</a>]</sup>
       </p>
 <p>
- For example, the following code will not compile:
+ For example, the following code does not compile (see also operator_error.cpp):
       </p>
 <p>
 </p>
-<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">point</span> <span class="special">{</span>
- <span class="keyword">int</span> <span class="identifier">x</span><span class="special">;</span>
- <span class="keyword">int</span> <span class="identifier">y</span><span class="special">;</span>
-<span class="special">};</span>
-
-<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test_operator_err</span> <span class="special">)</span> <span class="special">{</span>
- <span class="keyword">bool</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">point</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">point</span><span class="special">&amp;</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">x</span> <span class="special">==</span> <span class="identifier">q</span><span class="special">.</span><span class="identifier">x</span> <span class="special">&amp;&amp;</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">y</span> <span class="special">==</span> <span class="identifier">q</span><span class="special">.</span><span class="identifier">y</span><span class="special">;</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="keyword">operator</span><span class="special">==)</span> <span class="comment">// Error: Cannot use `operator...`.</span>
-
- <span class="identifier">point</span> <span class="identifier">a</span><span class="special">;</span> <span class="identifier">a</span><span class="special">.</span><span class="identifier">x</span> <span class="special">=</span> <span class="number">1</span><span class="special">;</span> <span class="identifier">a</span><span class="special">.</span><span class="identifier">y</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span>
- <span class="identifier">point</span> <span class="identifier">b</span> <span class="special">=</span> <span class="identifier">a</span><span class="special">;</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">a</span> <span class="special">==</span> <span class="identifier">b</span> <span class="special">);</span>
-<span class="special">}</span>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">point</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">point</span><span class="special">&amp;</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">x</span> <span class="special">==</span> <span class="identifier">q</span><span class="special">.</span><span class="identifier">x</span> <span class="special">&amp;&amp;</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">y</span> <span class="special">==</span> <span class="identifier">q</span><span class="special">.</span><span class="identifier">y</span><span class="special">;</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="keyword">operator</span><span class="special">==)</span> <span class="comment">// Error: Cannot use `operator...`.</span>
 </pre>
 <p>
       </p>
@@ -1163,25 +1234,42 @@
         <span><a name="boost_localfunction.Advanced_Topics.limitations__operators__etc_.goto"></a></span><a class="link" href="Advanced_Topics.html#boost_localfunction.Advanced_Topics.limitations__operators__etc_.goto">Goto</a>
       </h6>
 <p>
- It is not possible to jump with a <code class="computeroutput"><span class="keyword">goto</span></code>
- from within a local function to a label defined in the enclosing scope.
+ It is possible to jump with a <code class="computeroutput"><span class="keyword">goto</span></code>
+ within the local function body. For example, the following compiles (see
+ also goto.cpp):
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">error</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">z</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">z</span> <span class="special">&gt;</span> <span class="number">0</span><span class="special">)</span> <span class="keyword">goto</span> <span class="identifier">success</span><span class="special">;</span> <span class="comment">// OK: Can jump within local function.</span>
+ <span class="keyword">return</span> <span class="special">-</span><span class="number">1</span><span class="special">;</span>
+ <span class="identifier">success</span><span class="special">:</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">validate</span><span class="special">)</span>
+
+ <span class="keyword">return</span> <span class="identifier">validate</span><span class="special">(</span><span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
       </p>
 <p>
- For example, the following will not compile:
+ However, it is not possible to jump with a <code class="computeroutput"><span class="keyword">goto</span></code>
+ from within the local function body to to a label defined in the enclosing
+ scope. For example, the following does not compile (see also goto_error.cpp):
       </p>
 <p>
 </p>
 <pre class="programlisting"><span class="keyword">int</span> <span class="identifier">error</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span>
- <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span>
- <span class="keyword">if</span><span class="special">(</span><span class="identifier">x</span> <span class="special">&lt;=</span> <span class="number">0</span><span class="special">)</span> <span class="keyword">goto</span> <span class="identifier">failure</span><span class="special">;</span> <span class="comment">// Error: Cannot jump to enclosing scope.</span>
+ <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">z</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">if</span><span class="special">(</span><span class="identifier">z</span> <span class="special">&lt;=</span> <span class="number">0</span><span class="special">)</span> <span class="keyword">goto</span> <span class="identifier">failure</span><span class="special">;</span> <span class="comment">// Error: Cannot jump to enclosing scope.</span>
         <span class="keyword">else</span> <span class="keyword">goto</span> <span class="identifier">success</span><span class="special">;</span> <span class="comment">// OK: Can jump within local function.</span>
-
     <span class="identifier">success</span><span class="special">:</span>
         <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
     <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">validate</span><span class="special">)</span>
 
     <span class="keyword">return</span> <span class="identifier">validate</span><span class="special">(</span><span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span><span class="special">);</span>
-<span class="identifier">faliure</span><span class="special">:</span>
+<span class="identifier">failure</span><span class="special">:</span>
     <span class="keyword">return</span> <span class="special">-</span><span class="number">1</span><span class="special">;</span>
 <span class="special">}</span>
 </pre>
@@ -1197,7 +1285,7 @@
           need to be separated from the rest of the parameter declaration using the
           preprocessor. Specifically, this library needs to use preprocessor meta-programming
           to remove default values when constructing the local function type and
- then to count the number of default values to provide the correct set of
+ also to count the number of default values to provide the correct set of
           call operators for the local functor. Therefore, the symbol <code class="computeroutput"><span class="special">=</span></code> cannot be used because it cannot be handled
           by preprocessor meta-programming (non-alphanumeric symbols cannot be detected
           by preprocessor meta-programming because they cannot be concatenated by
@@ -1210,7 +1298,8 @@
           needs to be defined differently for compilers without variadic macros
           <code class="computeroutput"><span class="preprocessor">#define</span> <span class="identifier">WITH_DEFAULT</span>
           <span class="special">(</span><span class="keyword">default</span><span class="special">)</span></code> so it can only be defined by programmers
- based on the syntax they decide to use.
+ based on the syntax they decide to use (see the <a class="link" href="No_Variadic_Macros.html" title="Annex: No Variadic Macros">No
+ Variadic Macros</a> section).
         </p></div>
 <div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Advanced_Topics.commas_and_symbols_in_macros.f0" href="#boost_localfunction.Advanced_Topics.commas_and_symbols_in_macros.f0" class="para">19</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> This limitation is because
@@ -1232,11 +1321,11 @@
           <span class="bold"><strong>Rationale.</strong></span> The type names <code class="computeroutput"><span class="identifier">result_type</span></code> and <code class="computeroutput"><span class="identifier">arg</span></code><code class="literal"><span class="emphasis"><em>N</em></span></code><code class="computeroutput"><span class="identifier">_type</span></code> follow the Boost.TypeTraits
           naming conventions for function traits.
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Advanced_Topics.specifying_types.f0" href="#boost_localfunction.Advanced_Topics.specifying_types.f0" class="para">22</a>] </sup>
- In the examples of this documentation, we specify bound variables, function
- parameters, and result type in this order because this is the order used
- by <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions. However, the library accepts bound variables,
+<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Advanced_Topics.specifying_types__no_boost_typeof_.f0" href="#boost_localfunction.Advanced_Topics.specifying_types__no_boost_typeof_.f0" class="para">22</a>] </sup>
+ In the examples of this documentation, bound variables, function parameters,
+ and the result type are specified in this order because this is the order
+ used by <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a>. However, the library accepts bound variables,
           function parameters, and the result type in any order.
         </p></div>
 <div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Advanced_Topics.inlining.f0" href="#boost_localfunction.Advanced_Topics.inlining.f0" class="para">23</a>] </sup>
@@ -1245,27 +1334,28 @@
               as a template parameter (see the <a class="link" href="Implementation.html" title="Annex: Implementation">Implementation</a>
               section). No compiler has yet been observed to be able to inline function
               calls when they use such indirect function pointer calls. Therefore,
- inlined local functions do not use such indirect function pointer call
+ inline local functions do not use such indirect function pointer call
               (so they are more likely to be optimized) but because of that they
               cannot be passed as template parameters. The indirect function pointer
               call is needed on C++03
               but it is not needed on C++11
- (see [N2657])
+ (see [N2657]
+ and Boost.Config's
+ <code class="computeroutput"><span class="identifier">BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS</span></code>)
               thus this library automatically generates local function calls that
- can be inlined on C++11
+ can be inline on C++11
               compilers (even when the local function is not declared inline).
             </p></div>
 <div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Advanced_Topics.recursion.f0" href="#boost_localfunction.Advanced_Topics.recursion.f0" class="para">24</a>] </sup>
- <span class="bold"><strong>Rationale.</strong></span> This limitation comes from
- the fact that the global functor used to pass the local function as a
- template parameter (and eventually returned outside the declarations
- scope) does not know the local function name so the local function name
- used for recursive call cannot be set in the global functor. This limitation
- together with preventing the possibility for inlining are the reasons
- why local functions are not recursive unless programmers explicitly declare
- them <code class="computeroutput"><span class="identifier">recursive</span></code>.
- </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Advanced_Topics.storage_classifiers___auto__and__register__.f0" href="#boost_localfunction.Advanced_Topics.storage_classifiers___auto__and__register__.f0" class="para">25</a>] </sup>
+ <span class="bold"><strong>Rationale.</strong></span> This limitation comes from
+ the fact that the global functor used to pass the local function as a template
+ parameter (and eventually returned outside the declarations scope) does
+ not know the local function name so the local function name used for recursive
+ call cannot be set in the global functor. This limitation together with
+ preventing the possibility for inlining are the reasons why local functions
+ are not recursive unless programmers explicitly declare them <code class="computeroutput"><span class="identifier">recursive</span></code>.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Advanced_Topics.storage_classifiers.f0" href="#boost_localfunction.Advanced_Topics.storage_classifiers.f0" class="para">25</a>] </sup>
           The <code class="computeroutput"><span class="keyword">auto</span></code> storage classifier
           is part of the C++03
           standard and therefore supported by this library. However, the meaning
@@ -1275,7 +1365,27 @@
           classifier with the usual care in order to avoid writing C++03
           code that might not work on C++11.
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Advanced_Topics.limitations__operators__etc_.f1" href="#boost_localfunction.Advanced_Topics.limitations__operators__etc_.f1" class="para">26</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Advanced_Topics.same_line_expansions.f0" href="#boost_localfunction.Advanced_Topics.same_line_expansions.f0" class="para">26</a>] </sup>
+ <span class="bold"><strong>Rationale.</strong></span> The <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>
+ and <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code>
+ macros internally use <code class="computeroutput"><span class="identifier">__LINE__</span></code>
+ to generate unique identifiers. Therefore, if these macros are expanded
+ more than on time on the same line, the generated identifiers will no longer
+ be unique and the code will not compile. (This restriction does not apply
+ to MSVC and other compilers that provide the non-standard <code class="computeroutput"><span class="identifier">__COUNTER__</span></code> macro.) Note that the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code> macro
+ can always be expanded multiple times on the same line because the unique
+ local function name (and not <code class="computeroutput"><span class="identifier">__LINE__</span></code>)
+ is used by this macro to generate unique identifiers (so there is no need
+ for a <code class="computeroutput"><span class="identifier">BOOST_LOCAL_FUNCTION_NAME_ID</span></code>
+ macro).
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Advanced_Topics.same_line_expansions.f1" href="#boost_localfunction.Advanced_Topics.same_line_expansions.f1" class="para">27</a>] </sup>
+ Because there are restrictions on the set of tokens that the preprocessor
+ can concatenate and because not all compilers correctly implement these
+ restrictions, it is in general recommended to specify unique identifiers
+ as a combination of alphanumeric tokens.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Advanced_Topics.limitations__operators__etc_.f1" href="#boost_localfunction.Advanced_Topics.limitations__operators__etc_.f1" class="para">28</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> This is the because a local
           function name must be a valid local variable name (the local variable used
           to hold the local functor) and operators cannot be used as local variable

Modified: branches/release/libs/local_function/doc/html/boost_localfunction/Alternatives.html
==============================================================================
--- /trunk/libs/local_function/doc/html/boost_localfunction/Alternatives.html (original)
+++ branches/release/libs/local_function/doc/html/boost_localfunction/Alternatives.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,7 +6,7 @@
 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 <link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
 <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
-<link rel="prev" href="../BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX">
+<link rel="prev" href="Examples.html" title="Examples">
 <link rel="next" href="No_Variadic_Macros.html" title="Annex: No Variadic Macros">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="../BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="No_Variadic_Macros.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="Examples.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="No_Variadic_Macros.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="section boost_localfunction_Alternatives">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -120,26 +120,26 @@
             </td>
 <td>
               <p>
- Yes. Plus eventual compiler errors and debugging follow the usual
- format of C++ statement errors.
+ Yes. Plus eventual compiler errors and debugging retain their usual
+ meaning and format.
               </p>
             </td>
 <td>
               <p>
- Yes. Plus eventual compiler errors and debugging follow the usual
- format of C++ statement errors.
+ Yes. Plus eventual compiler errors and debugging retain their usual
+ meaning and format.
               </p>
             </td>
 <td>
               <p>
- Yes. Plus eventual compiler errors and debugging follow the usual
- format of C++ statement errors.
+ Yes. Plus eventual compiler errors and debugging retain their usual
+ meaning and format.
               </p>
             </td>
 <td>
               <p>
- Yes. Plus eventual compiler errors and debugging follow the usual
- format of C++ statement errors.
+ Yes. Plus eventual compiler errors and debugging retain their usual
+ meaning and format.
               </p>
             </td>
 <td>
@@ -231,7 +231,7 @@
                 Yes. The variable names are repeated in the function declaration
                 so they can be bound by value, by constant value, by reference, and
                 by constant reference (the object <code class="computeroutput"><span class="keyword">this</span></code>
- can also be bound).
+ can also be bound using <code class="computeroutput"><span class="identifier">this_</span></code>).
               </p>
             </td>
 <td>
@@ -241,7 +241,7 @@
                 at once) so they can be bound by constant value and by reference
                 (the object <code class="computeroutput"><span class="keyword">this</span></code> can
                 also be bound). However, variables cannot be bound by constant references
- and non-constant value (see below).
+ (see below).
               </p>
             </td>
 <td>
@@ -268,7 +268,7 @@
 <td>
               <p>
                 <span class="emphasis"><em>Polymorphic
- in the unbound parameter types</em></span>
+ in the function parameter type</em></span>
               </p>
             </td>
 <td>
@@ -305,42 +305,52 @@
     </p>
 <p>
       <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions have most of the features of this library (see also
- the example in the <a class="link" href="../index.html#boost_localfunction.Introduction" title="Introduction">Introduction</a>
+ lambda functions</a> have most of the features of this library plus some
+ additional feature (see also the example in the <a class="link" href="../index.html#boost_localfunction.Introduction" title="Introduction">Introduction</a>
       section):
     </p>
 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
 <li class="listitem">
           <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions can be defined within expressions while this library
+ lambda functions</a> can be defined within expressions while this library
           local functions can only be defined at declaration scope.
         </li>
 <li class="listitem">
           <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions are only supported by the C++11
+ lambda functions</a> are only supported by the C++11
           standard so they are not supported by all C++ compilers. This library local
           functions can be programmed also on C++03
           compilers (and they have performances comparable to <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions on C++11
+ lambda functions</a> on C++11
           compilers).
         </li>
 <li class="listitem">
           <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions do not allow to bind variables in scope by constant
- reference or by non-constant value. Because a variable cannot be bound
- by constant reference, <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions can bind a variable by constant only if the variable
+ lambda functions</a> do not allow to bind variables in scope by constant
+ reference. Because a variable cannot be bound by constant reference, <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a> can bind a variable by constant only if the variable
           is <code class="computeroutput"><span class="identifier">CopyConstructible</span></code> and
- the binding requires a (potentially expensive) extra copy operation. Both
- constant reference and non-constant value binding are instead supported
- by this library. However, <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions provide a short-hand syntax to bind all variables
+ the binding requires a (potentially expensive) extra copy operation. Constant
+ reference binding is instead supported by this library.
+ </li>
+<li class="listitem">
+ <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a> do not allow to bind data members selectively
+ without binding also the object <code class="computeroutput"><span class="keyword">this</span></code>
+ while this library local functions can bind either selected data members
+ or the entire object <code class="computeroutput"><span class="keyword">this</span></code>
+ (using <code class="computeroutput"><span class="identifier">this_</span></code>).
+ </li>
+<li class="listitem">
+ <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a> provide a short-hand syntax to bind all variables
           in scope at once (<code class="computeroutput"><span class="special">&amp;</span></code> or
- <code class="computeroutput"><span class="special">=</span></code>).
+ <code class="computeroutput"><span class="special">=</span></code>) while this library local
+ function always require to bind variables naming them one-by-one.
         </li>
 </ul></div>
 <p>
- For example, for non-copyable objects (see also noncopyable_lambda_err.cpp
+ For example, for non-copyable objects (see also noncopyable_cxx11_lambda_error.cpp
       and noncopyable_local_function.cpp):
     </p>
 <div class="informaltable"><table class="table">
@@ -351,7 +361,7 @@
 <thead><tr>
 <th>
               <p>
- C++11 Lambda
+ C++11 Lambda Function
               </p>
             </th>
 <th>
@@ -369,11 +379,12 @@
     <span class="identifier">n</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">_i</span><span class="special">):</span> <span class="identifier">i</span><span class="special">(</span><span class="identifier">_i</span><span class="special">)</span> <span class="special">{}</span>
 <span class="special">};</span>
 
+
 <span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
     <span class="identifier">n</span> <span class="identifier">x</span><span class="special">(-</span><span class="number">1</span><span class="special">);</span>
 
- <span class="keyword">auto</span> <span class="identifier">f</span> <span class="special">=</span> <span class="special">[</span><span class="identifier">x</span><span class="special">](</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Error: x is non-copyable, but if</span>
- <span class="identifier">assert</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">i</span> <span class="special">==</span> <span class="special">-</span><span class="number">1</span> <span class="special">);</span> <span class="comment">// bind `&amp;x` then `x` is not constant.</span>
+ <span class="keyword">auto</span> <span class="identifier">f</span> <span class="special">=</span> <span class="special">[</span><span class="identifier">x</span><span class="special">](</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Error: x is non-copyable, but if</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">x</span><span class="special">.</span><span class="identifier">i</span> <span class="special">==</span> <span class="special">-</span><span class="number">1</span><span class="special">);</span> <span class="comment">// bind `&amp;x` then `x` is not constant.</span>
     <span class="special">};</span>
     <span class="identifier">f</span><span class="special">();</span>
 
@@ -390,12 +401,13 @@
     <span class="keyword">int</span> <span class="identifier">i</span><span class="special">;</span>
     <span class="identifier">n</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">_i</span><span class="special">):</span> <span class="identifier">i</span><span class="special">(</span><span class="identifier">_i</span><span class="special">)</span> <span class="special">{}</span>
 <span class="special">};</span>
+<span class="identifier">BOOST_TYPEOF_REGISTER_TYPE</span><span class="special">(</span><span class="identifier">n</span><span class="special">)</span> <span class="comment">// Register for `bind&amp; x` below.</span>
 
-<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
     <span class="identifier">n</span> <span class="identifier">x</span><span class="special">(-</span><span class="number">1</span><span class="special">);</span>
 
     <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// OK: No copy</span>
- <span class="identifier">assert</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">i</span> <span class="special">==</span> <span class="special">-</span><span class="number">1</span> <span class="special">);</span> <span class="comment">// and constant.</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">x</span><span class="special">.</span><span class="identifier">i</span> <span class="special">==</span> <span class="special">-</span><span class="number">1</span><span class="special">);</span> <span class="comment">// and constant.</span>
     <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
     <span class="identifier">f</span><span class="special">();</span>
 
@@ -408,7 +420,7 @@
 </tr></tbody>
 </table></div>
 <p>
- Or, for objects with expensive copy operations (see also expensive_copy_lambda.cpp
+ Or, for objects with expensive copy operations (see also expensive_copy_cxx11_lambda.cpp
       and expensive_copy_local_function.cpp):
     </p>
 <div class="informaltable"><table class="table">
@@ -419,7 +431,7 @@
 <thead><tr>
 <th>
               <p>
- C++11 Lambda
+ C++11 Lambda Function
               </p>
             </th>
 <th>
@@ -435,16 +447,17 @@
 <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">struct</span> <span class="identifier">n</span> <span class="special">{</span>
     <span class="keyword">int</span> <span class="identifier">i</span><span class="special">;</span>
     <span class="identifier">n</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">_i</span><span class="special">):</span> <span class="identifier">i</span><span class="special">(</span><span class="identifier">_i</span><span class="special">)</span> <span class="special">{}</span>
- <span class="identifier">n</span><span class="special">(</span><span class="identifier">n</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">):</span> <span class="identifier">i</span><span class="special">(</span><span class="identifier">x</span><span class="special">.</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Some time consuming copy.</span>
+ <span class="identifier">n</span><span class="special">(</span><span class="identifier">n</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">):</span> <span class="identifier">i</span><span class="special">(</span><span class="identifier">x</span><span class="special">.</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Some time consuming copy operation.</span>
         <span class="keyword">for</span> <span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="number">10000</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="char">'.'</span><span class="special">;</span>
     <span class="special">}</span>
 <span class="special">};</span>
 
+
 <span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
     <span class="identifier">n</span> <span class="identifier">x</span><span class="special">(-</span><span class="number">1</span><span class="special">);</span>
 
     <span class="keyword">auto</span> <span class="identifier">f</span> <span class="special">=</span> <span class="special">[</span><span class="identifier">x</span><span class="special">]()</span> <span class="special">{</span> <span class="comment">// Problem: Expensive copy, but if bind</span>
- <span class="identifier">assert</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">i</span> <span class="special">==</span> <span class="special">-</span><span class="number">1</span><span class="special">);</span> <span class="comment">// by `&amp;x` then `x` is not constant.</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">x</span><span class="special">.</span><span class="identifier">i</span> <span class="special">==</span> <span class="special">-</span><span class="number">1</span><span class="special">);</span> <span class="comment">// by `&amp;x` then `x` is not constant.</span>
     <span class="special">};</span>
     <span class="identifier">f</span><span class="special">();</span>
 
@@ -460,16 +473,17 @@
 <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">struct</span> <span class="identifier">n</span> <span class="special">{</span>
     <span class="keyword">int</span> <span class="identifier">i</span><span class="special">;</span>
     <span class="identifier">n</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">_i</span><span class="special">):</span> <span class="identifier">i</span><span class="special">(</span><span class="identifier">_i</span><span class="special">)</span> <span class="special">{}</span>
- <span class="identifier">n</span><span class="special">(</span><span class="identifier">n</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">):</span> <span class="identifier">i</span><span class="special">(</span><span class="identifier">x</span><span class="special">.</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Some time consuming copy.</span>
+ <span class="identifier">n</span><span class="special">(</span><span class="identifier">n</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">):</span> <span class="identifier">i</span><span class="special">(</span><span class="identifier">x</span><span class="special">.</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Some time consuming copy operation.</span>
         <span class="keyword">for</span> <span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="number">10000</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="char">'.'</span><span class="special">;</span>
     <span class="special">}</span>
 <span class="special">};</span>
+<span class="identifier">BOOST_TYPEOF_REGISTER_TYPE</span><span class="special">(</span><span class="identifier">n</span><span class="special">)</span> <span class="comment">// Register for `bind&amp; x` below.</span>
 
 <span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
     <span class="identifier">n</span> <span class="identifier">x</span><span class="special">(-</span><span class="number">1</span><span class="special">);</span>
 
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// OK: No copy</span>
- <span class="identifier">assert</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">i</span> <span class="special">==</span> <span class="special">-</span><span class="number">1</span> <span class="special">);</span> <span class="comment">// and constant.</span>
+ <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// OK: No copy expensive</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">x</span><span class="special">.</span><span class="identifier">i</span> <span class="special">==</span> <span class="special">-</span><span class="number">1</span><span class="special">);</span> <span class="comment">// copy but constant.</span>
     <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
     <span class="identifier">f</span><span class="special">();</span>
 
@@ -483,14 +497,11 @@
 </table></div>
 <p>
       When constant binding functionality is needed for <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions, the best alternative might be to bind an extra local
+ lambda functions</a>, the best alternative might be to bind an extra local
       variable declared constant and initialized to the original variable (for example,
- <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">n</span><span class="special">&amp;</span> <span class="identifier">const_x</span> <span class="special">=</span> <span class="identifier">x</span></code> and then
- bind <code class="computeroutput"><span class="identifier">const_x</span></code> instead of <code class="computeroutput"><span class="identifier">x</span></code> to the lambda function). In many cases
- the use of the extra constant variable <code class="computeroutput"><span class="identifier">const_x</span></code>
- can be acceptable but in other cases (e.g., <span class="emphasis"><em>constant blocks</em></span>
- presented in the <a class="link" href="Examples.html" title="Examples">Examples</a>
- section) it might be preferable to maintain the same variable name <code class="computeroutput"><span class="identifier">x</span></code> within the function body.
+ see <span class="emphasis"><em>constant blocks</em></span> implemented with <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a> in the <a class="link" href="Examples.html" title="Examples">Examples</a>
+ section).
     </p>
 <p>
       <span class="bold"><strong>Local Functor</strong></span>
@@ -521,7 +532,7 @@
 <td>
               <p>
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">{</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
     <span class="keyword">int</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
 
     <span class="keyword">struct</span> <span class="identifier">local_add</span> <span class="special">{</span> <span class="comment">// Unfortunately, boilerplate code to program the class.</span>
@@ -530,6 +541,7 @@
         <span class="keyword">inline</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">int</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Body uses C++ statement syntax.</span>
             <span class="identifier">sum</span> <span class="special">+=</span> <span class="identifier">factor</span> <span class="special">*</span> <span class="identifier">num</span><span class="special">;</span>
         <span class="special">}</span>
+
     <span class="keyword">private</span><span class="special">:</span> <span class="comment">// Unfortunately, cannot bind so repeat variable types.</span>
         <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">;</span> <span class="comment">// Access `sum` by reference.</span>
         <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">factor</span><span class="special">;</span> <span class="comment">// Make `factor` constant.</span>
@@ -540,7 +552,8 @@
     <span class="comment">// Unfortunately, cannot pass as template parameter to `std::for_each`.</span>
     <span class="keyword">for</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="number">2</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="identifier">add</span><span class="special">(</span><span class="identifier">nums</span><span class="special">[</span><span class="identifier">i</span><span class="special">]);</span>
 
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span> <span class="special">);</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
@@ -549,7 +562,7 @@
 <td>
               <p>
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">{</span> <span class="comment">// Some local scope.</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Some local scope.</span>
     <span class="keyword">int</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span> <span class="comment">// Variables in scope to bind.</span>
 
     <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">factor</span><span class="special">,</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span>
@@ -560,7 +573,8 @@
     <span class="keyword">int</span> <span class="identifier">nums</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span><span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">};</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="number">2</span><span class="special">,</span> <span class="identifier">add</span><span class="special">);</span> <span class="comment">// Pass it to an algorithm.</span>
 
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span> <span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span><span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
@@ -604,12 +618,13 @@
     <span class="keyword">inline</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">int</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Body uses C++ statement syntax.</span>
         <span class="identifier">sum</span> <span class="special">+=</span> <span class="identifier">factor</span> <span class="special">*</span> <span class="identifier">num</span><span class="special">;</span>
     <span class="special">}</span>
+
 <span class="keyword">private</span><span class="special">:</span> <span class="comment">// Unfortunately, cannot bind so repeat variable types.</span>
     <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">;</span> <span class="comment">// Access `sum` by reference.</span>
     <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">factor</span><span class="special">;</span> <span class="comment">// Make `factor` constant.</span>
 <span class="special">};</span>
 
-<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test_add_global_functor</span> <span class="special">)</span> <span class="special">{</span>
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
     <span class="keyword">int</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
 
     <span class="identifier">global_add</span> <span class="identifier">add</span><span class="special">(</span><span class="identifier">sum</span><span class="special">,</span> <span class="identifier">factor</span><span class="special">);</span>
@@ -618,7 +633,8 @@
     <span class="keyword">int</span> <span class="identifier">nums</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span><span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">};</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="number">2</span><span class="special">,</span> <span class="identifier">add</span><span class="special">);</span> <span class="comment">// Passed as template parameter.</span>
 
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span> <span class="special">);</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
@@ -627,7 +643,7 @@
 <td>
               <p>
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">{</span> <span class="comment">// Some local scope.</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Some local scope.</span>
     <span class="keyword">int</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span> <span class="comment">// Variables in scope to bind.</span>
 
     <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">factor</span><span class="special">,</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span>
@@ -638,7 +654,8 @@
     <span class="keyword">int</span> <span class="identifier">nums</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span><span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">};</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="number">2</span><span class="special">,</span> <span class="identifier">add</span><span class="special">);</span> <span class="comment">// Pass it to an algorithm.</span>
 
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span> <span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span><span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
@@ -679,7 +696,7 @@
 <td>
               <p>
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">{</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
     <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">let</span><span class="special">;</span>
     <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">local_names</span><span class="special">::</span><span class="identifier">_f</span><span class="special">;</span>
     <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">cref</span><span class="special">;</span>
@@ -692,10 +709,11 @@
     <span class="comment">// Passed to template, `factor` by constant, and defined in expression.</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="number">3</span><span class="special">,</span> <span class="identifier">let</span><span class="special">(</span><span class="identifier">_f</span> <span class="special">=</span> <span class="identifier">cref</span><span class="special">(</span><span class="identifier">factor</span><span class="special">))[</span>
         <span class="comment">// Unfortunately, body cannot use C++ statement syntax.</span>
- <span class="identifier">ref</span><span class="special">(</span><span class="identifier">sum</span><span class="special">)</span> <span class="special">+=</span> <span class="identifier">_f</span> <span class="special">*</span> <span class="identifier">_1</span> <span class="comment">// Access `sum` by reference.</span>
+ <span class="identifier">ref</span><span class="special">(</span><span class="identifier">sum</span><span class="special">)</span> <span class="special">+=</span> <span class="identifier">_f</span> <span class="special">*</span> <span class="identifier">_1</span><span class="special">,</span> <span class="identifier">_1</span> <span class="comment">// Access `sum` by reference.</span>
     <span class="special">]);</span>
 
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span> <span class="special">);</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
@@ -704,7 +722,7 @@
 <td>
               <p>
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">{</span> <span class="comment">// Some local scope.</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Some local scope.</span>
     <span class="keyword">int</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span> <span class="comment">// Variables in scope to bind.</span>
 
     <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">factor</span><span class="special">,</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span>
@@ -715,7 +733,8 @@
     <span class="keyword">int</span> <span class="identifier">nums</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span><span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">};</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="number">2</span><span class="special">,</span> <span class="identifier">add</span><span class="special">);</span> <span class="comment">// Pass it to an algorithm.</span>
 
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span> <span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span><span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
@@ -735,7 +754,7 @@
     </h6>
 <p>
       The following tables compare run-times, compile-times, and binary sizes for
- the different alternatives presented here for local functions.
+ the different alternatives to local functions presented in this section.
     </p>
 <p>
       Overall, this library has compile-times and generates binary sizes similar
@@ -745,14 +764,16 @@
       <span class="special">...</span></code>). However, on compilers that allow
       to pass local types as template parameters (e.g., MSVC 8.0 or GCC 4.5.3 with
       <a href="http://www.open-std.org/JTC1/SC22/WG21/" target="_top">C++11</a> features
- enabled <code class="literal">-std=c++0x</code>, see also [N2657])
+ enabled <code class="literal">-std=c++0x</code>, see also [N2657]
+ and Boost.Config's <code class="computeroutput"><span class="identifier">BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS</span></code>)
       this library automatically generates optimized code that runs as fast as the
       fastest of the other approaches (see the "Boost.LocalFunction" approach
       below). When this library local function is specified <code class="computeroutput"><span class="keyword">inline</span></code>
       (see the "Boost.LocalFunction Inline" approach below and the <a class="link" href="Advanced_Topics.html" title="Advanced Topics">Advanced Topics</a> section)
       its run-times are always comparable to both the "Local Functor" and
       "Global Functor" approaches. However, in these cases the local function
- cannot be portably passed as template parameter (see [N2657])
+ cannot be portably passed as template parameter (see [N2657]
+ and Boost.Config's <code class="computeroutput"><span class="identifier">BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS</span></code>)
       so <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span></code> is replaced by a for-loop (on MSVC
       the for-loop, and not the local function in fact the same applies to local
       functors, was measured to have worst performances than using <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span></code>).
@@ -769,8 +790,8 @@
         The run-time performances of this library local functions are explained because
         on C++03
         compliant compilers (e.g., GCC 4.5.3 without <code class="literal">-std=c++0x</code>)
- this library needs to use a function pointer in order to pass the local function
- class as a template parameter (see [N2657]
+ this library needs to use a function pointer in order to portably pass the
+ local function class as a template parameter (see [N2657]
         and the <a class="link" href="Implementation.html" title="Annex: Implementation">Implementation</a>
         section). For all tested compilers, this function pointer prevents the compiler
         optimization algorithms from inlining the local function calls. Instead,
@@ -779,9 +800,11 @@
         calls for optimization. This run-time performance cost is not present on
         compilers that allow to pass local types as template parameters (e.g., MSVC
         8.0 or GCC 4.5.3 with C++11
- features enabled <code class="literal">-std=c++0x</code>) because this library does
- not have to use the extra function pointer to implement the local function
- call (it directly passes the local class type as template parameter).
+ features enabled <code class="literal">-std=c++0x</code>, see Boost.Config's
+ <code class="computeroutput"><span class="identifier">BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS</span></code>)
+ because this library does not have to use the extra function pointer to implement
+ the local function call (it directly passes the local class type as template
+ parameter).
       </p></td></tr>
 </table></div>
 <p>
@@ -800,8 +823,10 @@
       will perform with respect to each other when a more complex set of instructions
       is programmed for the local function body (e.g., <span class="emphasis"><em>if</em></span> a
       more complex set of instructions in the local function body were to inhibit
- some compilers from inlining functor objects also other approaches like Boost.Phoenix <span class="emphasis"><em>could</em></span>
- start to show higher run-times even when optimization is enabled).
+ some compiler from inlining function objects also other approaches like <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a> and Boost.Phoenix
+ <span class="emphasis"><em>could</em></span> start to show higher run-times even when optimization
+ is enabled).
     </p>
 <p>
       The following commands were executed from the library example directory to
@@ -880,7 +905,7 @@
 <tr>
 <td>
               <p>
- <span class="inlinemediaobject"><img src="../../../example/profile_legend_lambda.png" alt="profile_legend_lambda"></span>
+ <span class="inlinemediaobject"><img src="../../../example/profile_legend_cxx11_lambda.png" alt="profile_legend_cxx11_lambda"></span>
               </p>
             </td>
 <td>
@@ -891,7 +916,7 @@
             </td>
 <td>
               <p>
- profile_lambda.cpp
+ profile_cxx11_lambda.cpp
               </p>
             </td>
 </tr>
@@ -956,8 +981,8 @@
 <colgroup><col></colgroup>
 <thead><tr><th>
               <p>
- GCC 4.5.3 With C++11 Lambdas and "Local Types as Template Parameters"
- (<code class="literal">bjam cxxflags=-std=c++0x ...</code>)
+ GCC 4.5.3 With C++11 Lambda Functions and "Local Classes as
+ Template Parameters" (<code class="literal">bjam cxxflags=-std=c++0x ...</code>)
               </p>
             </th></tr></thead>
 <tbody>
@@ -965,14 +990,14 @@
               <p>
                 <span class="bold"><strong>Compiled with <code class="literal">bjam release ...</code>
                 for maximum optimization (<code class="literal">-O3 -finline-functions</code>)</strong></span>
- <span class="inlinemediaobject"><img src="../../../example/profile_gcc_cpp11_release.png" width="1170" alt="profile_gcc_cpp11_release"></span>
+ <span class="inlinemediaobject"><img src="../../../example/profile_gcc_cxx11_release.png" width="1170" alt="profile_gcc_cxx11_release"></span>
               </p>
             </td></tr>
 <tr><td>
               <p>
                 <span class="bold"><strong>Compiled with <code class="literal">bjam debug ...</code>
                 for no optimization (<code class="literal">-O0 -fno-inline</code>)</strong></span>
- <span class="inlinemediaobject"><img src="../../../example/profile_gcc_cpp11_debug.png" width="1170" alt="profile_gcc_cpp11_debug"></span>
+ <span class="inlinemediaobject"><img src="../../../example/profile_gcc_cxx11_debug.png" width="1170" alt="profile_gcc_cxx11_debug"></span>
               </p>
             </td></tr>
 </tbody>
@@ -981,9 +1006,8 @@
 <colgroup><col></colgroup>
 <thead><tr><th>
               <p>
- MSVC 8.0 With "Local Types as Template Parameters" (Without
- C++11
- Lambdas)
+ MSVC 8.0 With "Local Classes as Template Parameters" (Without
+ C++11 Lambda Functions)
               </p>
             </th></tr></thead>
 <tbody>
@@ -1008,7 +1032,7 @@
               <p>
                 GCC 4.3.4 With C++03
                 Only (Without C++11
- Lambdas and Without "Local Types as Template Parameters")
+ Lambda Functions and Without "Local Classes as Template Parameters")
               </p>
             </th></tr></thead>
 <tbody>
@@ -1040,7 +1064,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="../BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="No_Variadic_Macros.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="Examples.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="No_Variadic_Macros.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: branches/release/libs/local_function/doc/html/boost_localfunction/Examples.html
==============================================================================
--- /trunk/libs/local_function/doc/html/boost_localfunction/Examples.html (original)
+++ branches/release/libs/local_function/doc/html/boost_localfunction/Examples.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,7 +7,7 @@
 <link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
 <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
 <link rel="prev" href="Advanced_Topics.html" title="Advanced Topics">
-<link rel="next" href="../reference.html" title="Reference">
+<link rel="next" href="Alternatives.html" title="Annex: Alternatives">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="Advanced_Topics.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../reference.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="Advanced_Topics.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Alternatives.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="section boost_localfunction_Examples">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -28,7 +28,7 @@
 </h2></div></div></div>
 <div class="toc"><dl>
 <dt><span class="section"><a href="Examples.html#boost_localfunction.Examples.gcc_lambdas__without_c__11_">GCC
- Lambdas (Without C++11)</a></span></dt>
+ Lambdas (without C++11)</a></span></dt>
 <dt><span class="section"><a href="Examples.html#boost_localfunction.Examples.constant_blocks">Constant
       Blocks</a></span></dt>
 <dt><span class="section">Scope Exits</span></dt>
@@ -44,12 +44,12 @@
     </p>
 <div class="section boost_localfunction_Examples_gcc_lambdas__without_c__11_">
 <div class="titlepage"><div><div><h3 class="title">
-<a name="boost_localfunction.Examples.gcc_lambdas__without_c__11_"></a><a class="link" href="Examples.html#boost_localfunction.Examples.gcc_lambdas__without_c__11_" title="GCC Lambdas (Without C++11)">GCC
- Lambdas (Without C++11)</a>
+<a name="boost_localfunction.Examples.gcc_lambdas__without_c__11_"></a><a class="link" href="Examples.html#boost_localfunction.Examples.gcc_lambdas__without_c__11_" title="GCC Lambdas (without C++11)">GCC
+ Lambdas (without C++11)</a>
 </h3></div></div></div>
 <p>
- Combing local functions with the <a href="http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html" target="_top">statement
- expression</a> extension of GCC compilers, it is possible to implement
+ Combing local functions with the non-standard <a href="http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html" target="_top">statement
+ expression</a> extension of the GCC compiler, it is possible to implement
         lambda functions for GCC compilers even without C++11
         support.
       </p>
@@ -59,14 +59,14 @@
 <th align="left">Warning</th>
 </tr>
 <tr><td align="left" valign="top"><p>
- This code only works on compilers that support the statement expression
- GCC extension or that support <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions.
+ This code only works on compilers that support GCC statement expression
+ extension or that support <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a>.
         </p></td></tr>
 </table></div>
 <p>
         For example (see also gcc_lambda.cpp
- and gcc_lambda_cpp11.cpp):
+ and gcc_cxx11_lambda.cpp):
       </p>
 <div class="informaltable"><table class="table">
 <colgroup>
@@ -121,32 +121,63 @@
 </tr></tbody>
 </table></div>
 <p>
- Where the macros are defined in gcc_lambda.hpp.
+ The GCC lambda function macros are implemented using local functions (see
+ also gcc_lambda.hpp):
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="preprocessor"># define</span> <span class="identifier">GCC_LAMBDA_</span><span class="special">(</span><span class="identifier">binds</span><span class="special">,</span> <span class="identifier">params</span><span class="special">,</span> <span class="identifier">results</span><span class="special">)</span> <span class="special">\</span>
+ <span class="special">({</span> <span class="comment">/* open statement expression (GCC extension only) */</span> <span class="special">\</span>
+ <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">\</span>
+ <span class="identifier">BOOST_PP_LIST_ENUM</span><span class="special">(</span><span class="identifier">BOOST_PP_LIST_APPEND</span><span class="special">(</span><span class="identifier">binds</span><span class="special">,</span> <span class="special">\</span>
+ <span class="identifier">BOOST_PP_LIST_APPEND</span><span class="special">(</span><span class="identifier">params</span><span class="special">,</span> <span class="special">\</span>
+ <span class="identifier">BOOST_PP_IIF</span><span class="special">(</span><span class="identifier">BOOST_PP_LIST_IS_NIL</span><span class="special">(</span><span class="identifier">results</span><span class="special">),</span> <span class="special">\</span>
+ <span class="special">(</span><span class="keyword">return</span> <span class="keyword">void</span><span class="special">,</span> <span class="identifier">BOOST_PP_NIL</span><span class="special">)</span> <span class="comment">/* default for lambdas */</span> <span class="special">\</span>
+ <span class="special">,</span> <span class="special">\</span>
+ <span class="identifier">results</span> <span class="special">\</span>
+ <span class="special">)\</span>
+ <span class="special">)</span> <span class="special">\</span>
+ <span class="special">))</span> <span class="special">\</span>
+ <span class="special">)</span>
+</pre>
+<p>
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">GCC_LAMBDA_END_</span><span class="special">(</span><span class="identifier">id</span><span class="special">)</span> <span class="special">\</span>
+ <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">BOOST_PP_CAT</span><span class="special">(</span><span class="identifier">gcc_lambda_</span><span class="special">,</span> <span class="identifier">id</span><span class="special">))</span> <span class="special">\</span>
+ <span class="identifier">BOOST_PP_CAT</span><span class="special">(</span><span class="identifier">gcc_lambda_</span><span class="special">,</span> <span class="identifier">id</span><span class="special">);</span> <span class="special">\</span>
+ <span class="special">})</span> <span class="comment">/* close statement expression (GCC extension only) */</span>
+</pre>
+<p>
       </p>
 <p>
         This is possible because GCC statement expressions allow to use declaration
         statements within expressions and therefore to declare a local function within
         an expression. The macros automatically detect if the compiler supports
         <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions in which case the implementation uses native lambdas
- instead of local functions in statement expressions. However, <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions do not support constant binding so it is best to
+ lambda functions</a> in which case the implementation uses native lambdas
+ instead of local functions in GCC statement expressions. However, <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a> do not support constant binding so it is best to
         only use <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">bind</span>
- <span class="identifier">variable</span></code> (same as <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> <code class="computeroutput"><span class="special">=</span><span class="identifier">variable</span></code>)
- and <code class="computeroutput"><span class="identifier">bind</span><span class="special">&amp;</span>
- <span class="identifier">variable</span></code> (same as <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> <code class="computeroutput"><span class="special">&amp;</span><span class="identifier">variable</span></code>)
- because these have the exact same semantic between the local function and
- native lambda implementation. Unfortunately, the <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> short-hand binds <code class="computeroutput"><span class="special">&amp;</span></code>
- and <code class="computeroutput"><span class="special">=</span></code> (which automatically bind
- all variables in scope either by reference or value) are not supported by
- the macros because they are not supported by the local function implementation.
- Finally, the result type <code class="computeroutput"><span class="keyword">return</span> </code><code class="literal"><span class="emphasis"><em>result-type</em></span></code>
+ <span class="identifier">variable</span></code> (same as <code class="computeroutput"><span class="special">=</span><span class="identifier">variable</span></code>
+ for <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a>) and <code class="computeroutput"><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">variable</span></code>
+ (same as <code class="computeroutput"><span class="special">&amp;</span><span class="identifier">variable</span></code>
+ for <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a>') because these have the exact same semantic between
+ the local function and the native lambda implementations. Furthermore, local
+ functions allow to bind data members directly while <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a> require to access data members via binding the object
+ <code class="computeroutput"><span class="keyword">this</span></code>. Unfortunately, the short-hand
+ binds <code class="computeroutput"><span class="special">&amp;</span></code> and <code class="computeroutput"><span class="special">=</span></code> of <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a> (which automatically bind all variables in scope
+ either by reference or value) are not supported by these GCC lambda function
+ macros because they are not supported by local functions. Finally, the result
+ type <code class="computeroutput"><span class="keyword">return</span> </code><code class="literal"><span class="emphasis"><em>result-type</em></span></code>
         is optional and it is assumed <code class="computeroutput"><span class="keyword">void</span></code>
         when it is not specified (same as with <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions).
+ lambda functions</a>).
       </p>
 </div>
 <div class="section boost_localfunction_Examples_constant_blocks">
@@ -172,13 +203,14 @@
         Ideally this code will not compile instead this example not only compiles
         but the assertion even passes the run-time check and no error is generated
         at all. The [N1613]
- paper introduces the idea of a <span class="emphasis"><em>const-block</em></span> which could
- be used to wrap the assertion above and catch the programming error at compile-time.
- Similarly, the following code will generate a compile-time error when <code class="computeroutput"><span class="keyword">operator</span><span class="special">=</span></code>
+ paper introduces the concept of a <span class="emphasis"><em>const-block</em></span> which
+ could be used to wrap the assertion above and catch the programming error
+ at compile-time. Similarly, the following code will generate a compile-time
+ error when <code class="computeroutput"><span class="keyword">operator</span><span class="special">=</span></code>
         is mistakenly used instead of <code class="computeroutput"><span class="keyword">operator</span><span class="special">==</span></code> because both <code class="computeroutput"><span class="identifier">x</span></code>
         and <code class="computeroutput"><span class="identifier">y</span></code> are made constants
         (using local functions) within the block of code performing the assertion
- (see also const_block_err.cpp):
+ (see also const_block_error.cpp):
       </p>
 <div class="informaltable"><table class="table">
 <colgroup>
@@ -223,30 +255,70 @@
 </tr></tbody>
 </table></div>
 <p>
- Where the macros are defined in const_block.hpp.
+ The constant block macros are implemented using local functions (see also
+ const_block.hpp):
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">CONST_BLOCK_</span><span class="special">(</span><span class="identifier">variables</span><span class="special">)</span> <span class="special">\</span>
+ <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">\</span>
+ <span class="identifier">BOOST_PP_IIF</span><span class="special">(</span><span class="identifier">BOOST_PP_LIST_IS_NIL</span><span class="special">(</span><span class="identifier">variables</span><span class="special">,</span> <span class="special">\</span>
+ <span class="keyword">void</span> <span class="identifier">BOOST_PP_TUPLE_EAT</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special">\</span>
+ <span class="special">,</span> <span class="special">\</span>
+ <span class="identifier">BOOST_PP_LIST_FOR_EACH_I</span> <span class="special">\</span>
+ <span class="special">)(</span><span class="identifier">CONST_BLOCK_BIND_</span><span class="special">,</span> <span class="special">~,</span> <span class="identifier">variables</span><span class="special">)</span> <span class="special">\</span>
+ <span class="special">)</span>
+</pre>
+<p>
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">CONST_BLOCK_END_</span><span class="special">(</span><span class="identifier">id</span><span class="special">)</span> <span class="special">\</span>
+ <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">BOOST_PP_CAT</span><span class="special">(</span><span class="identifier">const_block_</span><span class="special">,</span> <span class="identifier">id</span><span class="special">))</span> <span class="special">\</span>
+ <span class="identifier">BOOST_PP_CAT</span><span class="special">(</span><span class="identifier">const_block_</span><span class="special">,</span> <span class="identifier">id</span><span class="special">)();</span> <span class="comment">/* call local function immediately */</span>
+</pre>
+<p>
       </p>
 <p>
         The constant block macros are implemented using a local function which binds
         by constant reference <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span></code>
         all the specified variables (so the variables are constant within the code
         block but they do not need to be <code class="computeroutput"><span class="identifier">CopyConstructible</span></code>
- and no extra copy is performed). The local function executes the <code class="computeroutput"><span class="identifier">assert</span></code> instruction in its body which is
+ and no extra copy is performed). The local function executes the <code class="computeroutput"><span class="identifier">assert</span></code> instruction in its body and it is
         called immediately after it is defined. More in general, constant blocks
         can be used to evaluate any instruction (not just assertions) within a block
         were all specified variables are constant.
       </p>
 <p>
         Unfortunately, constant blocks cannot be implemented with <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions because these do not support constant binding (of
- course it is always possible to introduce extra constant variables <code class="computeroutput"><span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">const_x</span>
- <span class="special">=</span> <span class="identifier">x</span></code>,
- etc and use these variables in the assertion). Variables bound by value using
- <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions (<code class="computeroutput"><span class="identifier">variable</span></code>,
+ lambda functions</a> because these do not support constant binding. Variables
+ bound by value using <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a> (<code class="computeroutput"><span class="identifier">variable</span></code>,
         <code class="computeroutput"><span class="special">=</span><span class="identifier">variable</span></code>,
         and <code class="computeroutput"><span class="special">=</span></code>) are constant but they
         are required to be <code class="computeroutput"><span class="identifier">CopyConstructible</span></code>
- and they introduce potentially expensive copy operations. <sup>[<a name="boost_localfunction.Examples.constant_blocks.f0" href="#ftn.boost_localfunction.Examples.constant_blocks.f0" class="footnote">27</a>]</sup>
+ and they introduce potentially expensive copy operations. <sup>[<a name="boost_localfunction.Examples.constant_blocks.f0" href="#ftn.boost_localfunction.Examples.constant_blocks.f0" class="footnote">29</a>]</sup> Of course it is always possible to introduce extra constant variables
+ and bind these variables to the <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
+ lambda functions</a> but the constant block code will then have to manage
+ the declaration and initialization of these extra variables plus it will
+ have to use the extra variable names instead of the original variable names:
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">x</span> <span class="special">=</span> <span class="number">1</span><span class="special">,</span> <span class="identifier">y</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span>
+<span class="keyword">const</span> <span class="identifier">decltype</span><span class="special">(</span><span class="identifier">x</span><span class="special">)&amp;</span> <span class="identifier">const_x</span> <span class="special">=</span> <span class="identifier">x</span><span class="special">;</span> <span class="comment">// Constant so cannot be modified</span>
+<span class="keyword">const</span> <span class="identifier">decltype</span><span class="special">(</span><span class="identifier">y</span><span class="special">)&amp;</span> <span class="identifier">const_y</span> <span class="special">=</span> <span class="identifier">y</span><span class="special">;</span> <span class="comment">// and reference so no copy.</span>
+<span class="special">[&amp;</span><span class="identifier">const_x</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">const_y</span><span class="special">]()</span> <span class="special">{</span> <span class="comment">// Lambda functions (C++11 only).</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">const_x</span> <span class="special">=</span> <span class="identifier">const_y</span><span class="special">);</span> <span class="comment">// Unfortunately, `const_` names.</span>
+<span class="special">}();</span>
+</pre>
+<p>
+ </p>
+<p>
+ In many cases the use of an extra constant variable <code class="computeroutput"><span class="identifier">const_x</span></code>
+ can be acceptable but in other cases it might be preferable to maintain the
+ same variable name <code class="computeroutput"><span class="identifier">x</span></code> within
+ the function body.
       </p>
 </div>
 <div class="section boost_localfunction_Examples_scope_exits">
@@ -266,9 +338,20 @@
         to introduce an extra <code class="computeroutput"><span class="keyword">const</span></code>
         local variable, assign it to the value to bind, and then bind the <code class="computeroutput"><span class="keyword">const</span></code> variable so to effectively have constant
         binding with Boost.ScopeExit
- as well). In general, the authors recommend to use Boost.ScopeExit
- instead of the code listed here whenever possible.
+ as well).
       </p>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../doc/src/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ In general, the authors recommend to use Boost.ScopeExit
+ instead of the code listed by this example whenever possible (because
+ Boost.ScopeExit
+ is a library deliberately designed to support the scope exit construct).
+ </p></td></tr>
+</table></div>
 <p>
         The following example binds <code class="computeroutput"><span class="identifier">p</span></code>
         by constant reference so this variable cannot be modified within the scope
@@ -308,22 +391,23 @@
                 </p>
               </td>
 <td>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">person&amp; p = persons_.back();
- person::evolution_t checkpoint = p.evolution_;
+ <p>
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">person</span><span class="special">&amp;</span> <span class="identifier">p</span> <span class="special">=</span> <span class="identifier">persons_</span><span class="special">.</span><span class="identifier">back</span><span class="special">();</span>
+<span class="identifier">person</span><span class="special">::</span><span class="identifier">evolution_t</span> <span class="identifier">checkpoint</span> <span class="special">=</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">evolution_</span><span class="special">;</span>
 
- BOOST_SCOPE_EXIT(checkpoint, &amp;p, this_) { // Or extra variable <code class="computeroutput"><span class="identifier">const_p</span></code>.
- if (checkpoint == p.evolution_) this_-&gt;persons_.pop_back();
- } BOOST_SCOPE_EXIT_END
+<span class="identifier">BOOST_SCOPE_EXIT</span><span class="special">(</span><span class="identifier">checkpoint</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">p</span><span class="special">,</span> <span class="identifier">this_</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Or extra variable `const_p`.</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">checkpoint</span> <span class="special">==</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">evolution_</span><span class="special">)</span> <span class="identifier">this_</span><span class="special">-&gt;</span><span class="identifier">persons_</span><span class="special">.</span><span class="identifier">pop_back</span><span class="special">();</span>
+<span class="special">}</span> <span class="identifier">BOOST_SCOPE_EXIT_END</span>
 </pre>
+<p>
+ </p>
               </td>
 </tr></tbody>
 </table></div>
 <p>
- Where the macros are defined in scope_exit.hpp.
- </p>
-<p>
         The scope exit macros are implemented by passing a local function when constructing
- an object of the following class:
+ an object of the following class (see also scope_exit.hpp):
       </p>
 <p>
 </p>
@@ -337,6 +421,22 @@
 <p>
       </p>
 <p>
+</p>
+<pre class="programlisting"><span class="preprocessor"># define</span> <span class="identifier">SCOPE_EXIT</span><span class="special">(...)</span> <span class="special">\</span>
+ <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="identifier">__VA_ARGS__</span><span class="special">)</span>
+</pre>
+<p>
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">SCOPE_EXIT_END_</span><span class="special">(</span><span class="identifier">id</span><span class="special">)</span> <span class="special">\</span>
+ <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">BOOST_PP_CAT</span><span class="special">(</span><span class="identifier">scope_exit_func_</span><span class="special">,</span> <span class="identifier">id</span><span class="special">))</span> <span class="special">\</span>
+ <span class="identifier">scope_exit</span> <span class="identifier">BOOST_PP_CAT</span><span class="special">(</span><span class="identifier">scope_exit_</span><span class="special">,</span> <span class="identifier">id</span><span class="special">)(</span> <span class="special">\</span>
+ <span class="identifier">BOOST_PP_CAT</span><span class="special">(</span><span class="identifier">scope_exit_func_</span><span class="special">,</span> <span class="identifier">id</span><span class="special">));</span>
+</pre>
+<p>
+ </p>
+<p>
         A local variable within the enclosing scope is used to hold the object so
         the destructor will be invoked at the exit of the enclosing scope and it
         will in turn call the local function executing the scope exit instructions.
@@ -375,7 +475,7 @@
 <td>
                 <p>
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test_phoenix_factorial_local</span> <span class="special">)</span> <span class="special">{</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
     <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">arg_names</span><span class="special">::</span><span class="identifier">arg1</span><span class="special">;</span>
 
     <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">n</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Unfortunately, monomorphic.</span>
@@ -386,8 +486,9 @@
             <span class="identifier">factorial</span><span class="special">(</span><span class="identifier">factorial_impl</span><span class="special">);</span> <span class="comment">// Phoenix function from local function.</span>
 
     <span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">4</span><span class="special">;</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">factorial</span><span class="special">(</span><span class="identifier">i</span><span class="special">)()</span> <span class="special">==</span> <span class="number">24</span> <span class="special">);</span> <span class="comment">// Call.</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">factorial</span><span class="special">(</span><span class="identifier">arg1</span><span class="special">)(</span><span class="identifier">i</span><span class="special">)</span> <span class="special">==</span> <span class="number">24</span> <span class="special">);</span> <span class="comment">// Lazy call.</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">factorial</span><span class="special">(</span><span class="identifier">i</span><span class="special">)()</span> <span class="special">==</span> <span class="number">24</span><span class="special">);</span> <span class="comment">// Call.</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">factorial</span><span class="special">(</span><span class="identifier">arg1</span><span class="special">)(</span><span class="identifier">i</span><span class="special">)</span> <span class="special">==</span> <span class="number">24</span><span class="special">);</span> <span class="comment">// Lazy call.</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
@@ -412,14 +513,15 @@
     <span class="special">}</span>
 <span class="special">};</span>
 
-<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test_phoenix_factorial</span> <span class="special">)</span> <span class="special">{</span>
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
     <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">arg_names</span><span class="special">::</span><span class="identifier">arg1</span><span class="special">;</span>
 
     <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="identifier">factorial_impl</span><span class="special">&gt;</span> <span class="identifier">factorial</span><span class="special">;</span>
 
     <span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">4</span><span class="special">;</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">factorial</span><span class="special">(</span><span class="identifier">i</span><span class="special">)()</span> <span class="special">==</span> <span class="number">24</span> <span class="special">);</span> <span class="comment">// Call.</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">factorial</span><span class="special">(</span><span class="identifier">arg1</span><span class="special">)(</span><span class="identifier">i</span><span class="special">)</span> <span class="special">==</span> <span class="number">24</span> <span class="special">);</span> <span class="comment">// Lazy call.</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">factorial</span><span class="special">(</span><span class="identifier">i</span><span class="special">)()</span> <span class="special">==</span> <span class="number">24</span><span class="special">);</span> <span class="comment">// Call.</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">factorial</span><span class="special">(</span><span class="identifier">arg1</span><span class="special">)(</span><span class="identifier">i</span><span class="special">)</span> <span class="special">==</span> <span class="number">24</span><span class="special">);</span> <span class="comment">// Lazy call.</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
@@ -430,9 +532,9 @@
 <p>
         This is presented here mainly as a curiosity because Boost.Phoenix
         functions created from local functions have the important limitation that
- they cannot be polymorphic. <sup>[<a name="boost_localfunction.Examples.boost_phoenix_functions.f0" href="#ftn.boost_localfunction.Examples.boost_phoenix_functions.f0" class="footnote">28</a>]</sup> Therefore, in many cases creating the Boost.Phoenix
+ they cannot be polymorphic. <sup>[<a name="boost_localfunction.Examples.boost_phoenix_functions.f0" href="#ftn.boost_localfunction.Examples.boost_phoenix_functions.f0" class="footnote">30</a>]</sup> Therefore, in many cases creating the Boost.Phoenix
         function from global functors (possibly with the help of Boost.Phoenix
- adaptor macros) might be a more valuable option.
+ adaptor macros) might be a more useful.
       </p>
 </div>
 <div class="section boost_localfunction_Examples_closures">
@@ -441,8 +543,9 @@
 </h3></div></div></div>
 <p>
         The following are examples of closures
- that illustrate how to return local functions to the calling scope (and the
- relative precautions to take).
+ that illustrate how to return local functions to the calling scope (note
+ how extra care is taken in order to ensure that all bound variables remain
+ valid at the calling scope):
       </p>
 <div class="informaltable"><table class="table">
 <colgroup><col></colgroup>
@@ -481,15 +584,16 @@
       Nested Functions</a>
 </h3></div></div></div>
 <p>
- The GCC C compiler supports local functions under the name of <a href="http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html" target="_top">nested
- functions</a>. Nested functions are exclusively a C extension of the
- GCC compiler (they are not supported for C++ not even by the GCC compiler,
+ The GCC C compiler supports local functions as a non-standard extension under
+ the name of <a href="http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html" target="_top">nested
+ functions</a>. Note that nested functions are exclusively a C extension
+ of the GCC compiler (they are not supported for C++ not even by the GCC compiler,
         and they are not part of any C or C++ standard, nor they are supported by
         other compilers like MSVC).
       </p>
 <p>
         The following examples are taken form the GCC nested function documentation
- and programmed using this library:
+ and programmed using local functions:
       </p>
 <div class="informaltable"><table class="table">
 <colgroup><col></colgroup>
@@ -522,8 +626,8 @@
 <a name="boost_localfunction.Examples.n_papers"></a><a class="link" href="Examples.html#boost_localfunction.Examples.n_papers" title="N-Papers">N-Papers</a>
 </h3></div></div></div>
 <p>
- The following examples are taken from a number of N-papers and programmed
- using this library.
+ The following examples are taken from different C++ "N-papers"
+ and programmed using local functions:
       </p>
 <div class="informaltable"><table class="table">
 <colgroup>
@@ -553,7 +657,7 @@
                 <p>
                   This example is adapted from [N2550]
                   (<a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions): It passes a local function to the STL
+ lambda functions</a>): It passes a local function to the STL
                   algorithm <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">find_if</span></code>.
                 </p>
               </td>
@@ -568,7 +672,7 @@
                 <p>
                   This example is adapted from [N2529]
                   (<a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions): It binds the object in scope <code class="computeroutput"><span class="keyword">this</span></code> to a local function.
+ lambda functions</a>): It binds the object in scope <code class="computeroutput"><span class="keyword">this</span></code> to a local function.
                 </p>
               </td>
 </tr>
@@ -577,12 +681,12 @@
 </div>
 <div class="footnotes">
 <br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Examples.constant_blocks.f0" href="#boost_localfunction.Examples.constant_blocks.f0" class="para">27</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Examples.constant_blocks.f0" href="#boost_localfunction.Examples.constant_blocks.f0" class="para">29</a>] </sup>
           Ideally, <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions would allow to bind variables also using <code class="computeroutput"><span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">variable</span></code> (constant reference) and <code class="computeroutput"><span class="keyword">const</span><span class="special">&amp;</span></code>
+ lambda functions</a> would allow to bind variables also using <code class="computeroutput"><span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">variable</span></code> (constant reference) and <code class="computeroutput"><span class="keyword">const</span><span class="special">&amp;</span></code>
           (all variables by constant reference).
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Examples.boost_phoenix_functions.f0" href="#boost_localfunction.Examples.boost_phoenix_functions.f0" class="para">28</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Examples.boost_phoenix_functions.f0" href="#boost_localfunction.Examples.boost_phoenix_functions.f0" class="para">30</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> Local functions can only be
           monomorphic because they are implemented using local classes and local
           classes cannot be templates in C++ (not even in C++11).
@@ -600,7 +704,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="Advanced_Topics.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../reference.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="Advanced_Topics.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Alternatives.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: branches/release/libs/local_function/doc/html/boost_localfunction/Getting_Started.html
==============================================================================
--- /trunk/libs/local_function/doc/html/boost_localfunction/Getting_Started.html (original)
+++ branches/release/libs/local_function/doc/html/boost_localfunction/Getting_Started.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -32,10 +32,9 @@
 <dt><span class="section"><a href="Getting_Started.html#boost_localfunction.Getting_Started.compilers_and_platforms">Compilers
       and Platforms</a></span></dt>
 <dt><span class="section">Installation</span></dt>
-<dt><span class="section">Configuration</span></dt>
 </dl></div>
 <p>
- This section explains how programmers can setup their system to use this library.
+ This section explains how to setup a system to use this library.
     </p>
 <div class="section boost_localfunction_Getting_Started_this_documentation">
 <div class="titlepage"><div><div><h3 class="title">
@@ -58,12 +57,13 @@
         of this library.
       </p>
 <p>
- In some of the examples presented in this documentation, the Boost.Test
- macro <code class="computeroutput"><span class="identifier">BOOST_CHECK</span></code> is used
- equivalently to <code class="computeroutput"><span class="identifier">assert</span></code> and
- the Boost.Test macro
- <code class="computeroutput"><span class="identifier">BOOST_AUTO_TEST_CASE</span></code> is used
- equivalently to <code class="computeroutput"><span class="identifier">main</span></code>. <sup>[<a name="boost_localfunction.Getting_Started.this_documentation.f0" href="#ftn.boost_localfunction.Getting_Started.this_documentation.f0" class="footnote">3</a>]</sup>
+ In most of the examples presented in this documentation, the Boost.Detail/LightweightTest
+ (<code class="literal">boost/detail/lightweight_test.hpp</code>) macro <code class="computeroutput"><span class="identifier">BOOST_TEST</span></code> is used to check correctness
+ conditions. The <code class="computeroutput"><span class="identifier">BOOST_TEST</span></code>
+ macro is conceptually similar to <code class="computeroutput"><span class="identifier">assert</span></code>
+ but a failure of the checked condition does not abort the program, instead
+ it makes <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span></code> return a non-zero program
+ exit code. <sup>[<a name="boost_localfunction.Getting_Started.this_documentation.f0" href="#ftn.boost_localfunction.Getting_Started.this_documentation.f0" class="footnote">3</a>]</sup>
       </p>
 </div>
 <div class="section boost_localfunction_Getting_Started_compilers_and_platforms">
@@ -75,15 +75,13 @@
         The implementation of this library uses preprocessor and template meta-programming
         (as supported by Boost.Preprocessor
         and Boost.MPL), templates
- with partial specializations and function pointers (similarly to Boost.Function).
- As a consequence, this library is fairly demanding on compilers' compliance
- with the C++03
- standard. At present, this library has been successfully compiled and tested
- on the following compilers and platforms:
+ with partial specializations and function pointers (similarly to Boost.Function),
+ and automatic type deduction (as supported by Boost.Typeof).
+ The authors originally developed and tested the library on:
       </p>
 <div class="orderedlist"><ol class="orderedlist" type="1">
 <li class="listitem">
- GNU Compiler Collection (GCC) 4.5.1 on Ubuntu Linux 10.
+ GNU Compiler Collection (GCC) C++ 4.5.1 on Ubuntu Linux 10.
           </li>
 <li class="listitem">
             GCC 4.3.4 and 4.5.3 (with and without C++11
@@ -91,12 +89,13 @@
             on Cygwin.
           </li>
 <li class="listitem">
- Miscrosoft Visual Studio Compiler (MSVC) 8.0 on Windows XP and Windows
- 7.
+ Miscrosoft Visual C++ (MSVC) 8.0 on Windows XP and Windows 7.
           </li>
 </ol></div>
 <p>
- This library has not yet been tested on any other compiler and platform.
+ See the library <a href="http://www.boost.org/development/tests/release/developer/local_function.html" target="_top">regressions
+ test results</a> for detailed information on supported compilers and
+ platforms.
       </p>
 </div>
 <div class="section boost_localfunction_Getting_Started_installation">
@@ -111,12 +110,14 @@
         option for MSVC, etc) and they can start compiling code using this library.
       </p>
 <p>
- This library implementation uses a number of Boost
- libraries among which: Boost.Preprocessor,
- Boost.ScopeExit,
- Boost.Typeof, Boost.TypeTraits, and
- Boost.MPL. These Boost libraries must be properly installed
- on your system in order for this library to work.
+ The library implementation uses Boost.Typeof
+ to automatically deduce the types of bound variables (see the <a class="link" href="Tutorial.html" title="Tutorial">Tutorial</a>
+ section). In order to compile code in type-of emulation mode, all types should
+ be properly registered using <code class="computeroutput"><span class="identifier">BOOST_TYPEOF_REGISTER_TYPE</span></code>
+ and <code class="computeroutput"><span class="identifier">BOOST_TYPEOF_REGISTER_TEMPLATE</span></code>,
+ or appropriate Boost.Typeof
+ headers should be included (see the source code of most examples presented
+ in this documentation).
       </p>
 <p>
         The followings are part of the library private API, they are not documented,
@@ -139,19 +140,11 @@
             Any symbol prefixed by <code class="computeroutput"><span class="identifier">BOOST_LOCAL_FUNCTION_AUX_</span><span class="special">...</span></code> or <code class="computeroutput"><span class="identifier">BOOST_LOCAL_FUNCTION_DETAIL_</span><span class="special">...</span></code> (regardless of its namespace).
           </li>
 </ul></div>
-</div>
-<div class="section boost_localfunction_Getting_Started_configuration">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_localfunction.Getting_Started.configuration"></a><a class="link" href="Getting_Started.html#boost_localfunction.Getting_Started.configuration" title="Configuration">Configuration</a>
-</h3></div></div></div>
 <p>
         Some of the library behaviour can be changed at compile-time by defining
         special <span class="emphasis"><em>configuration macros</em></span>. If a configuration macro
         is left undefined, the library will use an appropriate default value for
- it.
- </p>
-<p>
- All configuration macros are defined in the header file <code class="computeroutput"><a class="link" href="../reference.html#header.boost.local_function.config_hpp" title="Header &lt;boost/local_function/config.hpp&gt;">boost/local_function/config.hpp</a></code>.
+ it. All configuration macros are defined in the header file <code class="computeroutput"><a class="link" href="../reference.html#header.boost.local_function.config_hpp" title="Header &lt;boost/local_function/config.hpp&gt;">boost/local_function/config.hpp</a></code>.
         It is strongly recommended not to change the library configuration macro
         definitions unless strictly necessary.
       </p>
@@ -159,14 +152,14 @@
 <div class="footnotes">
 <br><hr width="100" align="left">
 <div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Getting_Started.this_documentation.f0" href="#boost_localfunction.Getting_Started.this_documentation.f0" class="para">3</a>] </sup>
- <span class="bold"><strong>Rationale.</strong></span> Using Boost.Test
- allows to add the documentation examples to the library regression tests
- so to make sure that the listed examples always compile and run correctly.
+ <span class="bold"><strong>Rationale.</strong></span> Using Boost.Detail/LightweightTest
+ allows to add the examples to the library regression tests so to make sure
+ that they always compile and run correctly.
         </p></div>
 <div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Getting_Started.installation.f0" href="#boost_localfunction.Getting_Started.installation.f0" class="para">4</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> This library concatenates symbols
           specified by the programmers (e.g., the local function name) with other
- symbols (e.g., special prefixes or preprocessor line numbers) to make internal
+ symbols (e.g., special prefixes or file line numbers) to make internal
           symbols with unique names to avoid name clashes. These symbols are separated
           by the letter "<code class="computeroutput"><span class="identifier">X</span></code>"
           when they are concatenated so they read more easily during debugging (the
@@ -176,7 +169,7 @@
           underscore, the concatenation could result in a symbol with double underscores
           "<code class="computeroutput"><span class="identifier">__</span></code>" which is
           reserved by the C++ standard). The "aux" symbols are private
- to this library while the "detail" symbols can be used within
+ to this library while the "detail" symbols may be used within
           Boost by other libraries but they are still not part of this library public
           API.
         </p></div>

Modified: branches/release/libs/local_function/doc/html/boost_localfunction/Implementation.html
==============================================================================
--- /trunk/libs/local_function/doc/html/boost_localfunction/Implementation.html (original)
+++ branches/release/libs/local_function/doc/html/boost_localfunction/Implementation.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,7 +7,7 @@
 <link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
 <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
 <link rel="prev" href="No_Variadic_Macros.html" title="Annex: No Variadic Macros">
-<link rel="next" href="Release_Notes.html" title="Release Notes">
+<link rel="next" href="../reference.html" title="Reference">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="No_Variadic_Macros.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Release_Notes.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="No_Variadic_Macros.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../reference.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="section boost_localfunction_Implementation">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -53,10 +53,11 @@
       local classes (and therefore the local function objects they implement) cannot
       be passed as template parameters (e.g., to the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span></code>
       algorithm), this is instead possible in C++11,
- MSVC, and some other compilers (see [N2657]).
+ MSVC, and some other compilers (see [N2657]
+ and Boost.Config's <code class="computeroutput"><span class="identifier">BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS</span></code>).
       To work around this limitation, this library investigated the following two
- "tricks" (both tricks can be extended to support eventual function
- default parameters):
+ "tricks" (both tricks can be extended to support function default
+ parameters):
     </p>
 <div class="orderedlist"><ol class="orderedlist" type="1">
 <li class="listitem">
@@ -64,13 +65,14 @@
           that calls a static member function of the local class via a function pointer.
           The static member function then calls the correct local function body after
           type casting the object from a <code class="computeroutput"><span class="keyword">void</span><span class="special">*</span></code> pointer (local classes can always be used
- for type casting).
+ for type casting via <code class="computeroutput"><span class="keyword">static_cast</span></code>
+ or similar).
         </li>
 <li class="listitem">
           The <span class="emphasis"><em>virtual functor trick</em></span> derives the local functor
           class from a non-local base class. The correct overridden implementation
           of the virtual <code class="computeroutput"><span class="keyword">operator</span><span class="special">()</span></code>
- is then called via polymorphism.
+ is then called via dynamic binding.
         </li>
 </ol></div>
 <p>
@@ -78,15 +80,14 @@
     </p>
 <p>
 </p>
-<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_TEST_MODULE</span> <span class="identifier">TestImplTparamTricks</span>
-<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">test</span><span class="special">/</span><span class="identifier">unit_test</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">detail</span><span class="special">/</span><span class="identifier">lightweight_test</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">vector</span><span class="special">&gt;</span>
 <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">algorithm</span><span class="special">&gt;</span>
 
 <span class="comment">// Casting functor trick.</span>
 <span class="keyword">struct</span> <span class="identifier">casting_func</span> <span class="special">{</span>
- <span class="keyword">explicit</span> <span class="identifier">casting_func</span><span class="special">(</span><span class="keyword">void</span><span class="special">*</span> <span class="identifier">obj</span><span class="special">,</span> <span class="keyword">void</span> <span class="special">(*</span><span class="identifier">call</span><span class="special">)(</span><span class="keyword">void</span><span class="special">*,</span> <span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;)):</span>
- <span class="identifier">obj_</span><span class="special">(</span><span class="identifier">obj</span><span class="special">),</span> <span class="identifier">call_</span><span class="special">(</span><span class="identifier">call</span><span class="special">)</span> <span class="special">{}</span>
+ <span class="keyword">explicit</span> <span class="identifier">casting_func</span><span class="special">(</span><span class="keyword">void</span><span class="special">*</span> <span class="identifier">obj</span><span class="special">,</span> <span class="keyword">void</span> <span class="special">(*</span><span class="identifier">call</span><span class="special">)(</span><span class="keyword">void</span><span class="special">*,</span> <span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;))</span>
+ <span class="special">:</span> <span class="identifier">obj_</span><span class="special">(</span><span class="identifier">obj</span><span class="special">),</span> <span class="identifier">call_</span><span class="special">(</span><span class="identifier">call</span><span class="special">)</span> <span class="special">{}</span>
     <span class="comment">// Unfortunately, function pointer call is not inlined.</span>
     <span class="keyword">inline</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">call_</span><span class="special">(</span><span class="identifier">obj_</span><span class="special">,</span> <span class="identifier">num</span><span class="special">);</span> <span class="special">}</span>
 <span class="keyword">private</span><span class="special">:</span>
@@ -106,18 +107,17 @@
     <span class="identifier">interface</span><span class="special">*</span> <span class="identifier">func_</span><span class="special">;</span>
 <span class="special">};</span>
 
-<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test_impl_tparam_tricks</span> <span class="special">)</span> <span class="special">{</span>
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
     <span class="keyword">int</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
 
     <span class="comment">// Local class for local function.</span>
- <span class="keyword">struct</span> <span class="identifier">local_add</span><span class="special">:</span> <span class="identifier">virtual_func</span><span class="special">::</span><span class="identifier">interface</span> <span class="special">{</span>
- <span class="keyword">explicit</span> <span class="identifier">local_add</span><span class="special">(</span><span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">_sum</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">_factor</span><span class="special">):</span>
- <span class="identifier">sum_</span><span class="special">(</span><span class="identifier">_sum</span><span class="special">),</span> <span class="identifier">factor_</span><span class="special">(</span><span class="identifier">_factor</span><span class="special">)</span> <span class="special">{}</span>
+ <span class="keyword">struct</span> <span class="identifier">local_add</span> <span class="special">:</span> <span class="identifier">virtual_func</span><span class="special">::</span><span class="identifier">interface</span> <span class="special">{</span>
+ <span class="keyword">explicit</span> <span class="identifier">local_add</span><span class="special">(</span><span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">_sum</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">_factor</span><span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">sum_</span><span class="special">(</span><span class="identifier">_sum</span><span class="special">),</span> <span class="identifier">factor_</span><span class="special">(</span><span class="identifier">_factor</span><span class="special">)</span> <span class="special">{}</span>
         <span class="keyword">inline</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span>
             <span class="identifier">body</span><span class="special">(</span><span class="identifier">sum_</span><span class="special">,</span> <span class="identifier">factor_</span><span class="special">,</span> <span class="identifier">num</span><span class="special">);</span>
         <span class="special">}</span>
- <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">call</span><span class="special">(</span>
- <span class="keyword">void</span><span class="special">*</span> <span class="identifier">obj</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">call</span><span class="special">(</span><span class="keyword">void</span><span class="special">*</span> <span class="identifier">obj</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span>
             <span class="identifier">local_add</span><span class="special">*</span> <span class="identifier">self</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special">&lt;</span><span class="identifier">local_add</span><span class="special">*&gt;(</span><span class="identifier">obj</span><span class="special">);</span>
             <span class="identifier">self</span><span class="special">-&gt;</span><span class="identifier">body</span><span class="special">(</span><span class="identifier">self</span><span class="special">-&gt;</span><span class="identifier">sum_</span><span class="special">,</span> <span class="identifier">self</span><span class="special">-&gt;</span><span class="identifier">factor_</span><span class="special">,</span> <span class="identifier">num</span><span class="special">);</span>
         <span class="special">}</span>
@@ -134,11 +134,12 @@
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">v</span><span class="special">(</span><span class="number">10</span><span class="special">);</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">fill</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="number">1</span><span class="special">);</span>
 
-<span class="comment">// std::for_each(v.begin(), v.end(), add_local); // Error but OK on C++11.</span>
+ <span class="comment">// std::for_each(v.begin(), v.end(), add_local); // Error but OK on C++11.</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">add_casting</span><span class="special">);</span> <span class="comment">// OK.</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">add_virtual</span><span class="special">);</span> <span class="comment">// OK.</span>
 
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">sum</span> <span class="special">==</span> <span class="number">200</span> <span class="special">);</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">sum</span> <span class="special">==</span> <span class="number">200</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
@@ -148,12 +149,13 @@
       the virtual functor trick so the current implementation of this library uses
       the casting functor trick (probably because in addition to the indirect function
       call, the virtual functor trick also requires accessing the <a href="http://en.wikipedia.org/wiki/Virtual_method_table" target="_top">virtual
- function table</a>). However, neither one of tricks has been observed to
- allow for compiler optimizations that inline the local function calls (because
+ function table</a>). However, neither one of the two tricks was observed
+ to allow for compiler optimizations that inline the local function calls (because
       they rely on one indirect function call via either a function pointer or a
- virtual function respectively). Therefore, on compilers that accept local types
+ virtual function respectively). Therefore, on compilers that accept local classes
       as template parameters (MSVC, C++11,
- etc, see [N2657]),
+ etc, see [N2657]
+ and Boost.Config's <code class="computeroutput"><span class="identifier">BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS</span></code>),
       this library automatically generates code that passes the local class type
       directly as template parameter without using neither one of these two tricks
       in order to take full advantage of compiler optimizations that inline the local
@@ -170,9 +172,9 @@
       (to generate special code to bind the object in scope), or if the variable
       is bound by <code class="computeroutput"><span class="keyword">const</span></code> (to generate
       special code to bind by constant), etc. The parameter tokens are inspected
- using preprocessor metaprogramming and specifically using the macros defined
+ using preprocessor meta-programming and specifically using the macros defined
       by the files in the <code class="literal">boost/local_function/detail/preprocessor/keyword/</code>
- directory. <sup>[<a name="boost_localfunction.Implementation.f0" href="#ftn.boost_localfunction.Implementation.f0" class="footnote">29</a>]</sup>
+ directory. <sup>[<a name="boost_localfunction.Implementation.f0" href="#ftn.boost_localfunction.Implementation.f0" class="footnote">31</a>]</sup>
     </p>
 <p>
       For example, the following code defines a macro that allows the preprocessor
@@ -184,8 +186,7 @@
 <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local_function</span><span class="special">/</span><span class="identifier">detail</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">keyword</span><span class="special">/</span><span class="identifier">thisunderscore</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local_function</span><span class="special">/</span><span class="identifier">detail</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">keyword</span><span class="special">/</span><span class="keyword">const</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local_function</span><span class="special">/</span><span class="identifier">detail</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">keyword</span><span class="special">/</span><span class="identifier">bind</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_TEST_MODULE</span> <span class="identifier">TestImplPpKeyword</span>
-<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">test</span><span class="special">/</span><span class="identifier">unit_test</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">detail</span><span class="special">/</span><span class="identifier">lightweight_test</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 
 <span class="comment">// Expand to 1 if space-separated tokens end with `this_`, 0 otherwise.</span>
 <span class="preprocessor">#define</span> <span class="identifier">IS_THIS_BACK</span><span class="special">(</span><span class="identifier">tokens</span><span class="special">)</span> <span class="special">\</span>
@@ -195,16 +196,17 @@
         <span class="identifier">tokens</span> <span class="special">\</span>
     <span class="special">)))</span>
 
-<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test_impl_pp_keyword</span> <span class="special">)</span> <span class="special">{</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">IS_THIS_BACK</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span> <span class="special">==</span> <span class="number">1</span> <span class="special">);</span>
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">IS_THIS_BACK</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">==</span> <span class="number">0</span> <span class="special">);</span>
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">IS_THIS_BACK</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span> <span class="special">==</span> <span class="number">1</span><span class="special">);</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">IS_THIS_BACK</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">==</span> <span class="number">0</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
     </p>
 <div class="footnotes">
 <br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Implementation.f0" href="#boost_localfunction.Implementation.f0" class="para">29</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Implementation.f0" href="#boost_localfunction.Implementation.f0" class="para">31</a>] </sup>
         This technique is at the core of even more complex preprocessor parsing macros
         like the ones that parse the Contract++
         syntax.
@@ -222,7 +224,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="No_Variadic_Macros.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Release_Notes.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="No_Variadic_Macros.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../reference.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: branches/release/libs/local_function/doc/html/boost_localfunction/No_Variadic_Macros.html
==============================================================================
--- /trunk/libs/local_function/doc/html/boost_localfunction/No_Variadic_Macros.html (original)
+++ branches/release/libs/local_function/doc/html/boost_localfunction/No_Variadic_Macros.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -57,18 +57,19 @@
     </p>
 <p>
 </p>
-<pre class="programlisting"><span class="special">{</span> <span class="comment">// Some local scope.</span>
- <span class="keyword">int</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span> <span class="comment">// Variables in scope to bind.</span>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">int</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
 
     <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">factor</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="identifier">sum</span> <span class="special">+=</span> <span class="identifier">factor</span> <span class="special">*</span> <span class="identifier">num</span><span class="special">;</span> <span class="comment">// Parameters as sequence.</span>
+ <span class="identifier">sum</span> <span class="special">+=</span> <span class="identifier">factor</span> <span class="special">*</span> <span class="identifier">num</span><span class="special">;</span>
     <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add</span><span class="special">)</span>
 
- <span class="identifier">add</span><span class="special">(</span><span class="number">1</span><span class="special">);</span> <span class="comment">// Call the local function.</span>
+ <span class="identifier">add</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
     <span class="keyword">int</span> <span class="identifier">nums</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span><span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">};</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="number">2</span><span class="special">,</span> <span class="identifier">add</span><span class="special">);</span> <span class="comment">// Pass it to an algorithm.</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="number">2</span><span class="special">,</span> <span class="identifier">add</span><span class="special">);</span>
 
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span> <span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
@@ -79,7 +80,7 @@
     </p>
 <p>
 </p>
-<pre class="programlisting"><span class="special">{</span> <span class="comment">// Some local scope.</span>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Some local scope.</span>
     <span class="keyword">int</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span> <span class="comment">// Variables in scope to bind.</span>
 
     <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">factor</span><span class="special">,</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span>
@@ -90,16 +91,17 @@
     <span class="keyword">int</span> <span class="identifier">nums</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span><span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">};</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="number">2</span><span class="special">,</span> <span class="identifier">add</span><span class="special">);</span> <span class="comment">// Pass it to an algorithm.</span>
 
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span> <span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span><span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
     </p>
 <p>
- Note how the same macros accept both syntaxes on compilers with variadic macros
+ Note that the same macros accept both syntaxes on compilers with variadic macros
       and only the sequence syntax on compilers without variadic macros. Finally,
- an parameter list is always specified using <code class="computeroutput"><span class="keyword">void</span></code>
- on compilers with and without variadic macros:
+ an empty local function parameter list is always specified using <code class="computeroutput"><span class="keyword">void</span></code> on compilers with and without variadic
+ macros:
     </p>
 <p>
 </p>
@@ -107,173 +109,144 @@
     <span class="keyword">return</span> <span class="number">10</span><span class="special">;</span>
 <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">ten</span><span class="special">)</span>
 
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">ten</span><span class="special">()</span> <span class="special">==</span> <span class="number">10</span> <span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">ten</span><span class="special">()</span> <span class="special">==</span> <span class="number">10</span><span class="special">);</span>
 </pre>
 <p>
     </p>
 <h6>
 <a name="boost_localfunction.No_Variadic_Macros.h1"></a>
- <span><a name="boost_localfunction.No_Variadic_Macros.an_example"></a></span><a class="link" href="No_Variadic_Macros.html#boost_localfunction.No_Variadic_Macros.an_example">An
- Example</a>
+ <span><a name="boost_localfunction.No_Variadic_Macros.examples"></a></span><a class="link" href="No_Variadic_Macros.html#boost_localfunction.No_Variadic_Macros.examples">Examples</a>
     </h6>
 <p>
- The following example shows a bit of all the different macro parameter combinations
- using the sequence syntax (see also seq.cpp):
- </p>
-<p>
-</p>
-<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">s</span> <span class="special">{</span>
- <span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">p</span> <span class="special">=</span> <span class="number">1.23</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">q</span> <span class="special">=</span> <span class="special">-</span><span class="number">1.23</span><span class="special">)</span> <span class="special">{</span>
- <span class="special">{</span> <span class="comment">// Only params.</span>
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">0</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">l</span><span class="special">)</span>
- <span class="identifier">l</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
- <span class="special">}</span>
- <span class="special">{</span> <span class="comment">// Only const binds.</span>
- <span class="keyword">int</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span><span class="special">;</span>
-
- <span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">b</span><span class="special">;</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">l</span><span class="special">)</span>
- <span class="identifier">l</span><span class="special">();</span>
-
- <span class="keyword">const</span> <span class="identifier">s</span><span class="special">&amp;</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="special">*</span><span class="identifier">this_</span><span class="special">;</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span>
- <span class="identifier">t</span><span class="special">();</span>
-
- <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">q</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">a</span><span class="special">;</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">lt</span><span class="special">)</span>
- <span class="identifier">lt</span><span class="special">();</span>
- <span class="special">}</span>
- <span class="special">{</span> <span class="comment">// Only plain binds.</span>
- <span class="keyword">int</span> <span class="identifier">c</span><span class="special">,</span> <span class="identifier">d</span><span class="special">;</span>
-
- <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span>
- <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">d</span><span class="special">;</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">l</span><span class="special">)</span>
- <span class="identifier">l</span><span class="special">();</span>
-
- <span class="identifier">s</span><span class="special">&amp;</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="special">*</span><span class="identifier">this_</span><span class="special">;</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span>
- <span class="identifier">t</span><span class="special">();</span>
-
- <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span>
- <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">c</span><span class="special">;</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">lt</span><span class="special">)</span>
- <span class="identifier">lt</span><span class="special">();</span>
- <span class="special">}</span>
-
- <span class="special">{</span> <span class="comment">// Both params and const binds.</span>
- <span class="keyword">int</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span><span class="special">;</span>
-
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">q</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">0</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">l</span><span class="special">)</span>
- <span class="identifier">l</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
-
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">0</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span>
- <span class="identifier">t</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
-
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">q</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">0</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">lt</span><span class="special">)</span>
- <span class="identifier">lt</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
- <span class="special">}</span>
- <span class="special">{</span> <span class="comment">// Both params and plain binds.</span>
- <span class="keyword">int</span> <span class="identifier">c</span><span class="special">,</span> <span class="identifier">d</span><span class="special">;</span>
-
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">q</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">0</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">l</span><span class="special">)</span>
- <span class="identifier">l</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
-
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">0</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span>
- <span class="identifier">t</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
-
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span>
- <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">q</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">0</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">lt</span><span class="special">)</span>
- <span class="identifier">lt</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
- <span class="special">}</span>
- <span class="special">{</span> <span class="comment">// Both const and plain binds.</span>
- <span class="keyword">int</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">c</span><span class="special">,</span> <span class="identifier">d</span><span class="special">;</span>
-
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">l</span><span class="special">)</span>
- <span class="identifier">l</span><span class="special">();</span>
-
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span>
- <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">ct</span><span class="special">)</span>
- <span class="identifier">ct</span><span class="special">();</span>
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">p</span><span class="special">)</span>
- <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">lct</span><span class="special">)</span>
- <span class="identifier">lct</span><span class="special">();</span>
-
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">pt</span><span class="special">)</span>
- <span class="identifier">pt</span><span class="special">();</span>
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">lpt</span><span class="special">)</span>
- <span class="identifier">lpt</span><span class="special">();</span>
- <span class="special">}</span>
-
- <span class="special">{</span> <span class="comment">// All params, const binds, and plain binds.</span>
- <span class="keyword">int</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">c</span><span class="special">,</span> <span class="identifier">d</span><span class="special">;</span>
-
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
- <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">)</span>
- <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">0</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">l</span><span class="special">)</span>
- <span class="identifier">l</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
-
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span>
- <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">q</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">0</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">ct</span><span class="special">)</span>
- <span class="identifier">ct</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
- <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">)</span>
- <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">0</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">pt</span><span class="special">)</span>
- <span class="identifier">pt</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
-
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span>
- <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">0</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">lct</span><span class="special">)</span>
- <span class="identifier">lct</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
- <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">b</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">this_</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">q</span><span class="special">)</span>
- <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">0</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">lpt</span><span class="special">)</span>
- <span class="identifier">lpt</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
- <span class="special">}</span>
- <span class="special">}</span>
-<span class="special">};</span>
-</pre>
-<p>
- </p>
+ For reference, the following is a list of most of the examples presented in
+ this documentation reprogrammed using the sequence syntax instead of the comma-separated
+ syntax (in alphabetic order):
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup><col></colgroup>
+<thead><tr><th>
+ <p>
+ Files
+ </p>
+ </th></tr></thead>
+<tbody>
+<tr><td>
+ <p>
+ add_classifiers_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ add_default_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ add_except_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ add_inline_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ add_params_only_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ add_template_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ add_this_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ add_typed_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ add_with_default_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ all_decl_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ factorial_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ macro_commas_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ nesting_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ overload_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ return_assign_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ return_derivative_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ return_inc_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ return_setget_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ return_this_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ same_line_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ transform_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ typeof_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ typeof_template_seq.cpp
+ </p>
+ </td></tr>
+</tbody>
+</table></div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
 <td align="left"></td>

Modified: branches/release/libs/local_function/doc/html/boost_localfunction/Release_Notes.html
==============================================================================
--- /trunk/libs/local_function/doc/html/boost_localfunction/Release_Notes.html (original)
+++ branches/release/libs/local_function/doc/html/boost_localfunction/Release_Notes.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,7 +6,7 @@
 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 <link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
 <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
-<link rel="prev" href="Implementation.html" title="Annex: Implementation">
+<link rel="prev" href="../BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS">
 <link rel="next" href="Bibliography.html" title="Bibliography">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="Implementation.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Bibliography.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Bibliography.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="section boost_localfunction_Release_Notes">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -32,8 +32,8 @@
     </p>
 <h6>
 <a name="boost_localfunction.Release_Notes.h0"></a>
- <span><a name="boost_localfunction.Release_Notes.version_1_0_0__2012_01_31_"></a></span><a class="link" href="Release_Notes.html#boost_localfunction.Release_Notes.version_1_0_0__2012_01_31_">Version
- 1.0.0 (2012-01-31)</a>
+ <span><a name="boost_localfunction.Release_Notes.version_1_0_0__2012_04_12_"></a></span><a class="link" href="Release_Notes.html#boost_localfunction.Release_Notes.version_1_0_0__2012_04_12_">Version
+ 1.0.0 (2012-04-12)</a>
     </h6>
 <div class="orderedlist"><ol class="orderedlist" type="1">
 <li class="listitem">
@@ -65,6 +65,17 @@
           Moved <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span></code>
           to Boost.Utility/IdentityType.
         </li>
+<li class="listitem">
+ Completely removed use of Boost.Typeof when bound and result types are
+ explicitly specified.
+ </li>
+<li class="listitem">
+ Added <code class="computeroutput"><span class="special">...</span><span class="identifier">_ID</span></code>
+ macros for multiple expansions on the same line.
+ </li>
+<li class="listitem">
+ Fixed compilation on Boost regression test platforms.
+ </li>
 </ol></div>
 <h6>
 <a name="boost_localfunction.Release_Notes.h1"></a>
@@ -151,7 +162,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="Implementation.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Bibliography.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Bibliography.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: branches/release/libs/local_function/doc/html/boost_localfunction/Tutorial.html
==============================================================================
--- /trunk/libs/local_function/doc/html/boost_localfunction/Tutorial.html (original)
+++ branches/release/libs/local_function/doc/html/boost_localfunction/Tutorial.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -34,7 +34,7 @@
 <dt><span class="section">Templates</span></dt>
 </dl></div>
 <p>
- This section illustrates basic usages of this library.
+ This section illustrates basic usage of this library.
     </p>
 <div class="section boost_localfunction_Tutorial_local_functions">
 <div class="titlepage"><div><div><h3 class="title">
@@ -44,7 +44,7 @@
         Local functions are defined using macros from the header file <code class="computeroutput"><a class="link" href="../reference.html#header.boost.local_function_hpp" title="Header &lt;boost/local_function.hpp&gt;">boost/local_function.hpp</a></code>. The
         macros must be used from within a declarative context (this is a limitation
         with respect to <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions which can instead be declared also within expressions):
+ lambda functions</a> which can instead be declared also within expressions):
       </p>
 <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local_function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// This library header.</span>
 
@@ -65,11 +65,17 @@
         which it is declared.
       </p>
 <p>
- The local function body is specified in a code block <code class="computeroutput"><span class="special">{</span>
- <span class="special">...</span> <span class="special">}</span></code>
- using the usual C++ syntax. The body is specified outside any of the macros
- so eventual compiler error messages and related line numbers retain their
- usual meaning and format. <sup>[<a name="boost_localfunction.Tutorial.local_functions.f1" href="#ftn.boost_localfunction.Tutorial.local_functions.f1" class="footnote">6</a>]</sup>
+ The local function result type is specified just before the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>
+ macro.
+ </p>
+<p>
+ The local function body is specified using the usual C++ statement syntax
+ in a code block <code class="computeroutput"><span class="special">{</span> <span class="special">...</span>
+ <span class="special">}</span></code> between the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>
+ and <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>
+ macros. The body is specified outside any of the macros so eventual compiler
+ error messages and related line numbers retain their usual meaning and format.
+ <sup>[<a name="boost_localfunction.Tutorial.local_functions.f1" href="#ftn.boost_localfunction.Tutorial.local_functions.f1" class="footnote">6</a>]</sup>
       </p>
 <p>
         The local function parameters are passed to the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>
@@ -84,7 +90,7 @@
         controlled at compile-time by the configuration macro <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX">BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX</a></code>.
         For example, let's program a local function named <code class="computeroutput"><span class="identifier">add</span></code>
         that adds together two integers <code class="computeroutput"><span class="identifier">x</span></code>
- and <code class="computeroutput"><span class="identifier">y</span></code> (see also add_params.cpp):
+ and <code class="computeroutput"><span class="identifier">y</span></code> (see also add_params_only.cpp):
       </p>
 <p>
 </p>
@@ -92,13 +98,13 @@
     <span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span><span class="special">;</span>
 <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add</span><span class="special">)</span>
 
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">add</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">)</span> <span class="special">==</span> <span class="number">3</span> <span class="special">);</span> <span class="comment">// Local function call.</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">add</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">)</span> <span class="special">==</span> <span class="number">3</span><span class="special">);</span> <span class="comment">// Local function call.</span>
 </pre>
 <p>
       </p>
 <p>
         If the local function has no parameter, it is possible to pass <code class="computeroutput"><span class="keyword">void</span></code> to the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>
- macro (similarly to the C syntax that allows to use <code class="literal"><span class="emphasis"><em>result-type
+ macro (similarly to the C++ syntax that allows to use <code class="literal"><span class="emphasis"><em>result-type
         function-name</em></span></code><code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span></code> to declare
         a function with no parameter): <sup>[<a name="boost_localfunction.Tutorial.local_functions.f2" href="#ftn.boost_localfunction.Tutorial.local_functions.f2" class="footnote">7</a>]</sup>
       </p>
@@ -113,7 +119,7 @@
     <span class="keyword">return</span> <span class="number">10</span><span class="special">;</span>
 <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">ten</span><span class="special">)</span>
 
-<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">ten</span><span class="special">()</span> <span class="special">==</span> <span class="number">10</span> <span class="special">);</span>
+<span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">ten</span><span class="special">()</span> <span class="special">==</span> <span class="number">10</span><span class="special">);</span>
 </pre>
 <p>
       </p>
@@ -123,29 +129,12 @@
 <a name="boost_localfunction.Tutorial.Binding"></a><a class="link" href="Tutorial.html#boost_localfunction.Tutorial.Binding" title="Binding Variables">Binding Variables</a>
 </h3></div></div></div>
 <p>
- Variables in scope (local variables, enclosing function parameters, member
- variables, etc) can be bound to a local function declaration. Only bound
- variables, static variables, global variables, functions, and enumerations
- from the enclosing scope are accessible from within the local function body.
- The types of bound variables are deduced automatically by this library.
- <sup>[<a name="boost_localfunction.Tutorial.Binding.f0" href="#ftn.boost_localfunction.Tutorial.Binding.f0" class="footnote">8</a>]</sup>
+ Variables in scope (local variables, enclosing function parameters, data
+ members, etc) can be bound to a local function declaration. Only bound variables,
+ static variables, global variables, functions, and enumerations from the
+ enclosing scope are accessible from within the local function body. The types
+ of bound variables are deduced automatically by this library using Boost.Typeof. <sup>[<a name="boost_localfunction.Tutorial.Binding.f0" href="#ftn.boost_localfunction.Tutorial.Binding.f0" class="footnote">8</a>]</sup>
       </p>
-<div class="important"><table border="0" summary="Important">
-<tr>
-<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td>
-<th align="left">Important</th>
-</tr>
-<tr><td align="left" valign="top"><p>
- The library implementation uses Boost.Typeof
- to automatically deduce the types of the bound variables. Therefore, in
- order to compile code in type-of emulation mode, all types should be properly
- registered with <code class="computeroutput"><span class="identifier">BOOST_TYPEOF_REGISTER_TYPE</span></code>
- or <code class="computeroutput"><span class="identifier">BOOST_TYPEOF_REGISTER_TEMPLATE</span></code>
- macros, or appropriate Boost.Typeof
- headers should be included (see the Boost.Typeof
- documentation for more detail).
- </p></td></tr>
-</table></div>
 <p>
         This library introduces the new "keyword" <code class="computeroutput"><span class="identifier">bind</span></code>
         <sup>[<a name="boost_localfunction.Tutorial.Binding.f1" href="#ftn.boost_localfunction.Tutorial.Binding.f1" class="footnote">9</a>]</sup> which is used in place of the parameter type to specify the name
@@ -189,9 +178,9 @@
         by reference).
       </p>
 <p>
- The type of a bound variable is automatically deduced and it is the exact
- same type used to declare such a variable in the enclosing scope with the
- following notes:
+ The type of a bound variable is automatically deduced using Boost.Typeof
+ and it is the exact same type used to declare such a variable in the enclosing
+ scope with the following notes:
       </p>
 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
 <li class="listitem">
@@ -203,7 +192,7 @@
             scope then it will not be bound as constant unless constant binding is
             forced using <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">...</span></code>. (Note that binding by constant reference
             is not supported by <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions but it is supported by this library.) <sup>[<a name="boost_localfunction.Tutorial.Binding.f3" href="#ftn.boost_localfunction.Tutorial.Binding.f3" class="footnote">11</a>]</sup>
+ lambda functions</a> but it is supported by this library.) <sup>[<a name="boost_localfunction.Tutorial.Binding.f3" href="#ftn.boost_localfunction.Tutorial.Binding.f3" class="footnote">11</a>]</sup>
           </li>
 <li class="listitem">
             If a bound variable was declared as a reference in the enclosing scope,
@@ -213,11 +202,11 @@
           </li>
 </ul></div>
 <p>
- When a variable is bound by value (constant or not), its type must be <code class="computeroutput"><span class="identifier">CopyConstructible</span></code> (i.e., its must provide
- a copy constructor). As with passing parameters to usual C++ functions, programmers
- might want to bind variables of complex types by (possibly constant) reference
- instead of by value to avoid expensive copy operations when these variables
- are bound to a local function.
+ When a variable is bound by value (constant or not), its type must be CopyConstructible (i.e., its must
+ provide a copy constructor). As with passing parameters to usual C++ functions,
+ programmers might want to bind variables of complex types by (possibly constant)
+ reference instead of by value to avoid expensive copy operations when these
+ variables are bound to a local function.
       </p>
 <p>
         For example, let's program the local function <code class="computeroutput"><span class="identifier">add</span></code>
@@ -231,7 +220,7 @@
       </p>
 <p>
 </p>
-<pre class="programlisting"><span class="special">{</span> <span class="comment">// Some local scope.</span>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Some local scope.</span>
     <span class="keyword">int</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span> <span class="comment">// Variables in scope to bind.</span>
 
     <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">factor</span><span class="special">,</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span>
@@ -242,7 +231,8 @@
     <span class="keyword">int</span> <span class="identifier">nums</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span><span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">};</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="number">2</span><span class="special">,</span> <span class="identifier">add</span><span class="special">);</span> <span class="comment">// Pass it to an algorithm.</span>
 
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span> <span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span><span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
@@ -315,7 +305,7 @@
 <p>
 </p>
 <pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">adder</span> <span class="special">{</span>
- <span class="identifier">adder</span><span class="special">():</span> <span class="identifier">sum_</span><span class="special">(</span><span class="number">0</span><span class="special">)</span> <span class="special">{}</span>
+ <span class="identifier">adder</span><span class="special">()</span> <span class="special">:</span> <span class="identifier">sum_</span><span class="special">(</span><span class="number">0</span><span class="special">)</span> <span class="special">{}</span>
 
     <span class="keyword">int</span> <span class="identifier">sum</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;&amp;</span> <span class="identifier">nums</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">)</span> <span class="special">{</span>
 
@@ -326,6 +316,7 @@
         <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">nums</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">add</span><span class="special">);</span>
         <span class="keyword">return</span> <span class="identifier">sum_</span><span class="special">;</span>
     <span class="special">}</span>
+
 <span class="keyword">private</span><span class="special">:</span>
     <span class="keyword">int</span> <span class="identifier">sum_</span><span class="special">;</span>
 <span class="special">};</span>
@@ -337,7 +328,7 @@
         object <code class="computeroutput"><span class="identifier">this_</span></code> regardless of
         their access level (<code class="computeroutput"><span class="keyword">public</span></code>,
         <code class="computeroutput"><span class="keyword">protected</span></code>, or <code class="computeroutput"><span class="keyword">private</span></code>). <sup>[<a name="boost_localfunction.Tutorial.binding_the_object__this_.f2" href="#ftn.boost_localfunction.Tutorial.binding_the_object__this_.f2" class="footnote">15</a>]</sup> Specifically, in the example above the local function updates
- the <code class="computeroutput"><span class="keyword">private</span></code> data member <code class="computeroutput"><span class="identifier">sum_</span></code>.
+ the private data member <code class="computeroutput"><span class="identifier">sum_</span></code>.
       </p>
 </div>
 <div class="section boost_localfunction_Tutorial_templates">
@@ -346,7 +337,8 @@
 </h3></div></div></div>
 <p>
         When local functions are programmed within templates, they need to be declared
- using the special macro <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code>:
+ using the special macros <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code>
+ and <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_NAME_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_NAME_TPL">BOOST_LOCAL_FUNCTION_NAME_TPL</a></code>:
         <sup>[<a name="boost_localfunction.Tutorial.templates.f0" href="#ftn.boost_localfunction.Tutorial.templates.f0" class="footnote">16</a>]</sup>
       </p>
 <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local_function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// This library header.</span>
@@ -356,14 +348,16 @@
     <span class="special">...</span>
     <span class="emphasis"><em>result-type</em></span> <span class="identifier">BOOST_LOCAL_FUNCTION_TPL</span><span class="special">(</span><span class="emphasis"><em>parameters</em></span><span class="special">)</span> <span class="special">{</span>
         <span class="emphasis"><em>body-code</em></span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="emphasis"><em>name</em></span><span class="special">)</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME_TPL</span><span class="special">(</span><span class="emphasis"><em>name</em></span><span class="special">)</span>
     <span class="special">...</span>
 <span class="special">}</span>
 </pre>
 <p>
         The <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code>
- macro has the exact same syntax of the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>
- macro that we have seen so far.
+ and <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_NAME_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_NAME_TPL">BOOST_LOCAL_FUNCTION_NAME_TPL</a></code>
+ macros have the exact same syntax of the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>
+ and <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>
+ macros that we have seen so far.
       </p>
 <p>
         For example, let's program a local function similar to the one from the
@@ -376,10 +370,10 @@
 <span class="identifier">T</span> <span class="identifier">total</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">z</span><span class="special">)</span> <span class="special">{</span>
     <span class="identifier">T</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">(),</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
 
- <span class="comment">// Using the `..._TPL` macro.</span>
+ <span class="comment">// Must use the `..._TPL` macros within templates.</span>
     <span class="identifier">T</span> <span class="identifier">BOOST_LOCAL_FUNCTION_TPL</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">factor</span><span class="special">,</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">,</span> <span class="identifier">T</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span>
         <span class="keyword">return</span> <span class="identifier">sum</span> <span class="special">+=</span> <span class="identifier">factor</span> <span class="special">*</span> <span class="identifier">num</span><span class="special">;</span>
- <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add</span><span class="special">)</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME_TPL</span><span class="special">(</span><span class="identifier">add</span><span class="special">)</span>
 
     <span class="identifier">add</span><span class="special">(</span><span class="identifier">x</span><span class="special">);</span>
     <span class="identifier">T</span> <span class="identifier">nums</span><span class="special">[</span><span class="number">2</span><span class="special">];</span> <span class="identifier">nums</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">y</span><span class="special">;</span> <span class="identifier">nums</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">z</span><span class="special">;</span>
@@ -446,8 +440,8 @@
           and <code class="computeroutput"><span class="identifier">bind</span> <span class="keyword">const</span>
           <span class="special">...</span></code> equivalently. However, handling
           both syntaxes would have complicated the macro implementation without adding
- any feature so only one syntax (<code class="computeroutput"><span class="keyword">const</span>
- <span class="identifier">bind</span> <span class="special">...</span></code>)
+ any feature so only one syntax <code class="computeroutput"><span class="keyword">const</span>
+ <span class="identifier">bind</span> <span class="special">...</span></code>
           is supported.
         </p></div>
 <div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Tutorial.Binding.f3" href="#boost_localfunction.Tutorial.Binding.f3" class="para">11</a>] </sup>
@@ -471,17 +465,17 @@
               is used so that references can be bound by both value <code class="computeroutput"><span class="special">[</span><span class="keyword">const</span><span class="special">]</span> <span class="identifier">bind</span></code>
               and reference <code class="computeroutput"><span class="special">[</span><span class="keyword">const</span><span class="special">]</span> <span class="identifier">bind</span><span class="special">&amp;</span></code> (this is the same binding semantic
               adopted by Boost.ScopeExit).
- On the other hand, variables originally declared as constants should
- never loose their <code class="computeroutput"><span class="keyword">const</span></code>
- qualifier (to prevent their modification not just in the enclosing
- scope but also in the local scope) thus they are always bound by constant
- even if <code class="computeroutput"><span class="identifier">bind</span><span class="special">[&amp;]</span></code>
+ However, variables originally declared as constants should never loose
+ their <code class="computeroutput"><span class="keyword">const</span></code> qualifier
+ (to prevent their modification not just in the enclosing scope but
+ also in the local scope) thus they are always bound by constant even
+ if <code class="computeroutput"><span class="identifier">bind</span><span class="special">[&amp;]</span></code>
               is used instead of <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">[&amp;]</span></code>.
             </p></div>
 <div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Tutorial.binding_the_object__this_.f0" href="#boost_localfunction.Tutorial.binding_the_object__this_.f0" class="para">13</a>] </sup>
- <span class="bold"><strong>Rationale.</strong></span> The special name <code class="computeroutput"><span class="identifier">this_</span></code> was chosen following <a href="http://boost.2283326.n4.nabble.com/local-this-or-this-td3423912.html" target="_top">Boost
- practises</a> which postfix with an underscore identifiers that are
- named after keywords (the C++ keyword <code class="computeroutput"><span class="keyword">this</span></code>
+ <span class="bold"><strong>Rationale.</strong></span> The special name <code class="computeroutput"><span class="identifier">this_</span></code> was chosen following <a href="http://lists.boost.org/Archives/boost/2011/04/179729.php" target="_top">Boost
+ practise</a> to postfix with an underscore identifiers that are named
+ after keywords (the C++ keyword <code class="computeroutput"><span class="keyword">this</span></code>
           in this case). The special symbol <code class="computeroutput"><span class="identifier">this_</span></code>
           is needed because <code class="computeroutput"><span class="keyword">this</span></code> is
           a reserved C++ keyword so it cannot be used as the name of the internal
@@ -500,11 +494,10 @@
             be a static member function of the local functor object in order to support
             recursion (because the local function name is specified by the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>
             macro only after the body so it must be made available via a functor
- member variable named after the local function and local classes cannot
- have static member variables in C++) and nesting (because the argument
- binding variable must be declared as a member variable so it is visible
- in a local function nested within the body member function) -- see the
- <a class="link" href="Implementation.html" title="Annex: Implementation">Implementation</a>
+ data member named after the local function and local classes cannot have
+ static data members in C++) and nesting (because the argument binding
+ variable must be declared as a data member so it is visible in a local
+ function nested within the body member function) -- see the <a class="link" href="Implementation.html" title="Annex: Implementation">Implementation</a>
             section. Therefore, from within the local function body the variable
             <code class="computeroutput"><span class="keyword">this</span></code> is visible but it refers
             to the local functor and not to the bound object.
@@ -520,10 +513,13 @@
           needs to use <code class="computeroutput"><span class="keyword">typename</span></code> to explicitly
           indicate that some expressions evaluate to a type. Because C++03
           does not allow to use <code class="computeroutput"><span class="keyword">typename</span></code>
- outside templates, the special <code class="computeroutput"><span class="identifier">TPL</span></code>
- macro is used to indicate that the enclosing scope is a template so this
- library can safely use <code class="computeroutput"><span class="keyword">typename</span></code>
- to resolve expression type ambiguities.
+ outside templates, the special <code class="computeroutput"><span class="special">...</span><span class="identifier">_TPL</span></code> macros are used to indicate that
+ the enclosing scope is a template so this library can safely use <code class="computeroutput"><span class="keyword">typename</span></code> to resolve expression type ambiguities.
+ C++11 and
+ other compilers might compile local functions within templates even when
+ the <code class="computeroutput"><span class="special">...</span><span class="identifier">_TPL</span></code>
+ macros are not used. However, it is recommended to always use the <code class="computeroutput"><span class="special">...</span><span class="identifier">_TPL</span></code>
+ macros within templates to maximize portability.
         </p></div>
 </div>
 </div>

Modified: branches/release/libs/local_function/doc/html/index.html
==============================================================================
--- /trunk/libs/local_function/doc/html/index.html (original)
+++ branches/release/libs/local_function/doc/html/index.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -45,7 +45,6 @@
 <dt><span class="section"><a href="boost_localfunction/Getting_Started.html#boost_localfunction.Getting_Started.compilers_and_platforms">Compilers
       and Platforms</a></span></dt>
 <dt><span class="section">Installation</span></dt>
-<dt><span class="section">Configuration</span></dt>
 </dl></dd>
 <dt><span class="section">Tutorial</span></dt>
 <dd><dl>
@@ -61,27 +60,29 @@
       Parameters</a></span></dt>
 <dt><span class="section"><a href="boost_localfunction/Advanced_Topics.html#boost_localfunction.Advanced_Topics.commas_and_symbols_in_macros">Commas
       and Symbols in Macros</a></span></dt>
-<dt><span class="section"><a href="boost_localfunction/Advanced_Topics.html#boost_localfunction.Advanced_Topics.assigning_and_returning">Assigning
- and Returning</a></span></dt>
+<dt><span class="section"><a href="boost_localfunction/Advanced_Topics.html#boost_localfunction.Advanced_Topics.assignments_and_returns">Assignments
+ and Returns</a></span></dt>
 <dt><span class="section">Nesting</span></dt>
 <dt><span class="section"><a href="boost_localfunction/Advanced_Topics.html#boost_localfunction.Advanced_Topics.accessing_types__concepts__etc_">Accessing
       Types (concepts, etc)</a></span></dt>
-<dt><span class="section"><a href="boost_localfunction/Advanced_Topics.html#boost_localfunction.Advanced_Topics.specifying_types">Specifying
- Types</a></span></dt>
+<dt><span class="section"><a href="boost_localfunction/Advanced_Topics.html#boost_localfunction.Advanced_Topics.specifying_types__no_boost_typeof_">Specifying
+ Types (no Boost.Typeof)</a></span></dt>
 <dt><span class="section">Inlining</span></dt>
 <dt><span class="section">Recursion</span></dt>
 <dt><span class="section">Overloading</span></dt>
 <dt><span class="section"><a href="boost_localfunction/Advanced_Topics.html#boost_localfunction.Advanced_Topics.exception_specifications">Exception
       Specifications</a></span></dt>
-<dt><span class="section"><a href="boost_localfunction/Advanced_Topics.html#boost_localfunction.Advanced_Topics.storage_classifiers___auto__and__register__">Storage
- Classifiers (<code class="computeroutput"><span class="keyword">auto</span></code> and <code class="computeroutput"><span class="keyword">register</span></code>)</a></span></dt>
+<dt><span class="section"><a href="boost_localfunction/Advanced_Topics.html#boost_localfunction.Advanced_Topics.storage_classifiers">Storage
+ Classifiers</a></span></dt>
+<dt><span class="section"><a href="boost_localfunction/Advanced_Topics.html#boost_localfunction.Advanced_Topics.same_line_expansions">Same
+ Line Expansions</a></span></dt>
 <dt><span class="section"><a href="boost_localfunction/Advanced_Topics.html#boost_localfunction.Advanced_Topics.limitations__operators__etc_">Limitations
       (operators, etc)</a></span></dt>
 </dl></dd>
 <dt><span class="section">Examples</span></dt>
 <dd><dl>
 <dt><span class="section"><a href="boost_localfunction/Examples.html#boost_localfunction.Examples.gcc_lambdas__without_c__11_">GCC
- Lambdas (Without C++11)</a></span></dt>
+ Lambdas (without C++11)</a></span></dt>
 <dt><span class="section"><a href="boost_localfunction/Examples.html#boost_localfunction.Examples.constant_blocks">Constant
       Blocks</a></span></dt>
 <dt><span class="section">Scope Exits</span></dt>
@@ -92,33 +93,34 @@
       Nested Functions</a></span></dt>
 <dt><span class="section">N-Papers</span></dt>
 </dl></dd>
+<dt><span class="section">Annex: Alternatives</span></dt>
+<dt><span class="section"><a href="boost_localfunction/No_Variadic_Macros.html">Annex: No Variadic
+ Macros</a></span></dt>
+<dt><span class="section">Annex: Implementation</span></dt>
 <dt><span class="section">Reference</span></dt>
 <dd><dl>
 <dt><span class="section">Header <boost/local_function.hpp></span></dt>
 <dt><span class="section">Header <boost/local_function/config.hpp></span></dt>
 </dl></dd>
-<dt><span class="section">Annex: Alternatives</span></dt>
-<dt><span class="section"><a href="boost_localfunction/No_Variadic_Macros.html">Annex: No Variadic
- Macros</a></span></dt>
-<dt><span class="section">Annex: Implementation</span></dt>
 <dt><span class="section">Release Notes</span></dt>
 <dt><span class="section">Bibliography</span></dt>
 <dt><span class="section">Acknowledgments</span></dt>
 </dl>
 </div>
 <p>
- This library allows to program functions locally, directly within the scope where
- they are needed.
+ This library allows to program functions locally, within other functions, and
+ directly within the scope where they are needed.
   </p>
 <div class="section boost_localfunction_Introduction">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
 <a name="boost_localfunction.Introduction"></a><a class="link" href="index.html#boost_localfunction.Introduction" title="Introduction">Introduction</a>
 </h2></div></div></div>
 <p>
- <span class="emphasis"><em>Local functions</em></span> are a form of <span class="emphasis"><em>information hiding</em></span>
+ <span class="emphasis"><em>Local functions</em></span> (a.k.a., <a href="http://en.wikipedia.org/wiki/Nested_function" target="_top"><span class="emphasis"><em>nested
+ functions</em></span></a>) are a form of <span class="emphasis"><em>information hiding</em></span>
       and they are useful for dividing procedural tasks into subtasks which are only
       meaningful locally, avoiding cluttering other parts of the program with functions,
- variables, etc unrelated to those parts. Local functions therefore complement
+ variables, etc unrelated to those parts. Therefore, local functions complement
       other structuring possibilities such as namespaces and classes. Local functions
       are a feature of many programming languages, notably Pascal
       and Ada,
@@ -127,12 +129,13 @@
     </p>
 <p>
       Using <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions, it is possible to implement local functions by naming
- the lambdas assigning them to local variables. For example (see also add_lambda.cpp):
+ lambda functions</a>, it is possible to implement local functions by naming
+ lambda functions assigning them to local variables. For example (see also
+ add_cxx11_lambda.cpp):
     </p>
 <p>
 </p>
-<pre class="programlisting"><span class="special">{</span> <span class="comment">// Some local scope.</span>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Some local scope.</span>
     <span class="keyword">int</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span> <span class="comment">// Variables in scope to bind.</span>
 
     <span class="keyword">auto</span> <span class="identifier">add</span> <span class="special">=</span> <span class="special">[</span><span class="identifier">factor</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">sum</span><span class="special">](</span><span class="keyword">int</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// C++11 only.</span>
@@ -143,7 +146,8 @@
     <span class="keyword">int</span> <span class="identifier">nums</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span><span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">};</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="number">2</span><span class="special">,</span> <span class="identifier">add</span><span class="special">);</span> <span class="comment">// Pass it to an algorithm.</span>
 
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span> <span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span><span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
@@ -151,13 +155,12 @@
 <p>
       This library allows to program local functions portably between C++03
       and C++11 (and
- with performances comparable to lambdas on C++11
- compilers, see the <a class="link" href="boost_localfunction/Alternatives.html" title="Annex: Alternatives">Alternatives</a>
- section). For example (see also add.cpp):
+ with performances comparable to lambda functions on C++11
+ compilers). For example (see also add.cpp):
     </p>
 <p>
 </p>
-<pre class="programlisting"><span class="special">{</span> <span class="comment">// Some local scope.</span>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Some local scope.</span>
     <span class="keyword">int</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span> <span class="comment">// Variables in scope to bind.</span>
 
     <span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">factor</span><span class="special">,</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">{</span>
@@ -168,7 +171,8 @@
     <span class="keyword">int</span> <span class="identifier">nums</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span><span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">};</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="number">2</span><span class="special">,</span> <span class="identifier">add</span><span class="special">);</span> <span class="comment">// Pass it to an algorithm.</span>
 
- <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span> <span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="identifier">sum</span> <span class="special">==</span> <span class="number">60</span><span class="special">);</span> <span class="comment">// Assert final summation value.</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span><span class="special">();</span>
 <span class="special">}</span>
 </pre>
 <p>
@@ -189,7 +193,7 @@
         </li>
 <li class="listitem">
           Local functions can be passed as template parameters so they can be conveniently
- used with STL algorithms, etc. <sup>[<a name="boost_localfunction.Introduction.f0" href="#ftn.boost_localfunction.Introduction.f0" class="footnote">1</a>]</sup>
+ used with STL algorithms and other templates. <sup>[<a name="boost_localfunction.Introduction.f0" href="#ftn.boost_localfunction.Introduction.f0" class="footnote">1</a>]</sup>
         </li>
 <li class="listitem">
           However, local functions must be specified within a declarative context
@@ -200,7 +204,7 @@
 <p>
       See the <a class="link" href="boost_localfunction/Alternatives.html" title="Annex: Alternatives">Alternatives</a>
       section for a comparison between this library, <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions, Boost.Phoenix,
+ lambda functions</a>, Boost.Phoenix,
       and other C++ techniques that implement features related to local functions.
     </p>
 </div>
@@ -215,14 +219,14 @@
           </p></div>
 <div class="footnote"><p><sup>[<a id="ftn.boost_localfunction.Introduction.f1" href="#boost_localfunction.Introduction.f1" class="para">2</a>] </sup>
             This is a weakness with respect to <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions which can instead be specified also within expressions
+ lambda functions</a> which can instead be specified also within expressions
             (see the <a class="link" href="boost_localfunction/Alternatives.html" title="Annex: Alternatives">Alternatives</a>
             section).
           </p></div>
 </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 15:46:08 GMT</small></p></td>
+<td align="left"><p><small>Last revised: April 13, 2012 at 00:19:19 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: branches/release/libs/local_function/doc/html/reference.html
==============================================================================
--- /trunk/libs/local_function/doc/html/reference.html (original)
+++ branches/release/libs/local_function/doc/html/reference.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,7 +6,7 @@
 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 <link rel="home" href="index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
 <link rel="up" href="index.html" title="Chapter&#160;1.&#160;Boost.LocalFunction 1.0.0">
-<link rel="prev" href="boost_localfunction/Examples.html" title="Examples">
+<link rel="prev" href="boost_localfunction/Implementation.html" title="Annex: Implementation">
 <link rel="next" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="boost_localfunction/Examples.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="boost_localfunction/Implementation.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="section reference">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -32,12 +32,15 @@
 <div class="section header_boost_local_function_hpp">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="header.boost.local_function_hpp"></a>Header &lt;boost/local_function.hpp&gt;</h3></div></div></div>
-<p>Local functions allow to program functions locally, directly within the scope where they are needed. </p>
+<p>Local functions allow to program functions locally, within other functions, and directly within the scope where they are needed. </p>
 <pre class="synopsis">
 
 <a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a>(declarations)
 <a class="link" href="BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a>(declarations)
-<a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a>(qualified_function_name)
+<a class="link" href="BOOST_LOCAL_FUNCTION_ID.html" title="Macro BOOST_LOCAL_FUNCTION_ID">BOOST_LOCAL_FUNCTION_ID</a>(id, declarations)
+<a class="link" href="BOOST_LOCAL_FUNCTION_TPL_ID.html" title="Macro BOOST_LOCAL_FUNCTION_TPL_ID">BOOST_LOCAL_FUNCTION_TPL_ID</a>(id, declarations)
+<a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a>(qualified_name)
+<a class="link" href="BOOST_LOCAL_FUNCTION_NAME_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_NAME_TPL">BOOST_LOCAL_FUNCTION_NAME_TPL</a>(name)
 <a class="link" href="BOOST_LOCAL_FUNCTION_TYPEOF.html" title="Macro BOOST_LOCAL_FUNCTION_TYPEOF">BOOST_LOCAL_FUNCTION_TYPEOF</a>(bound_variable_name)</pre>
 </div>
 <div class="section header_boost_local_function_config_hpp">
@@ -47,7 +50,8 @@
 <pre class="synopsis">
 
 <a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX">BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX</a>
-<a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX">BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX</a></pre>
+<a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX">BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX</a>
+<a class="link" href="BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS">BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS</a></pre>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
@@ -61,7 +65,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="boost_localfunction/Examples.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="boost_localfunction/Implementation.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_LOCAL_FUNCTION.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: branches/release/libs/local_function/doc/implementation.qbk
==============================================================================
--- /trunk/libs/local_function/doc/implementation.qbk (original)
+++ branches/release/libs/local_function/doc/implementation.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,7 +5,7 @@
 [/ http://www.boost.org/LICENSE_1_0.txt) ]
 [/ Home at http://www.boost.org/libs/local_function ]
 
-[section:Implementation Annex: Implementation]
+[section:implementation Annex: Implementation]
 
 This section gives an overview of the key programming techniques used to implement this library.
 
@@ -14,30 +14,30 @@
 There is absolutely no guarantee that the library implementation uses the exact code listed here.
 ]
 
-[h5 Local Classes as Template Parameters]
+[heading Local Classes as Template Parameters]
 
 This library uses a local class to implement the local function object.
-However, in __CPP03__ local classes (and therefore the local function objects they implement) cannot be passed as template parameters (e.g., to the `std::for_each` algorithm), this is instead possible in __CPP11__, MSVC, and some other compilers (see __N2657__).
-To work around this limitation, this library investigated the following two "tricks" (both tricks can be extended to support eventual function default parameters):
+However, in __CXX03__ local classes (and therefore the local function objects they implement) cannot be passed as template parameters (e.g., to the `std::for_each` algorithm), this is instead possible in __CXX11__, MSVC, and some other compilers (see __N2657__ and __Boost_Config__'s `BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS`).
+To work around this limitation, this library investigated the following two "tricks" (both tricks can be extended to support function default parameters):
 
 # The /casting functor trick/ uses a non-local functor that calls a static member function of the local class via a function pointer.
-The static member function then calls the correct local function body after type casting the object from a `void*` pointer (local classes can always be used for type casting).
+The static member function then calls the correct local function body after type casting the object from a `void*` pointer (local classes can always be used for type casting via `static_cast` or similar).
 
 # The /virtual functor trick/ derives the local functor class from a non-local base class.
-The correct overridden implementation of the virtual `operator()` is then called via polymorphism.
+The correct overridden implementation of the virtual `operator()` is then called via dynamic binding.
 
 For example (see also [@../../example/impl_tparam_tricks.cpp =impl_tparam_tricks.cpp=]):
 
 [impl_tparam_tricks]
 
 The casting functor trick measured slightly better run-time performances than the virtual functor trick so the current implementation of this library uses the casting functor trick (probably because in addition to the indirect function call, the virtual functor trick also requires accessing the [@http://en.wikipedia.org/wiki/Virtual_method_table virtual function table]).
-However, neither one of tricks has been observed to allow for compiler optimizations that inline the local function calls (because they rely on one indirect function call via either a function pointer or a virtual function respectively).
-Therefore, on compilers that accept local types as template parameters (MSVC, __CPP11__, etc, see __N2657__), this library automatically generates code that passes the local class type directly as template parameter without using neither one of these two tricks in order to take full advantage of compiler optimizations that inline the local function calls.
+However, neither one of the two tricks was observed to allow for compiler optimizations that inline the local function calls (because they rely on one indirect function call via either a function pointer or a virtual function respectively).
+Therefore, on compilers that accept local classes as template parameters (MSVC, __CXX11__, etc, see __N2657__ and __Boost_Config__'s `BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS`), this library automatically generates code that passes the local class type directly as template parameter without using neither one of these two tricks in order to take full advantage of compiler optimizations that inline the local function calls.
 
-[h5 Parsing Macros]
+[heading Parsing Macros]
 
 This library macros can parse the list of specified parameters and detect if any of the bound variable names matches the token `this_` (to generate special code to bind the object in scope), or if the variable is bound by `const` (to generate special code to bind by constant), etc.
-The parameter tokens are inspected using preprocessor metaprogramming and specifically using the macros defined by the files in the =boost/local_function/detail/preprocessor/keyword/= directory.
+The parameter tokens are inspected using preprocessor meta-programming and specifically using the macros defined by the files in the =boost/local_function/detail/preprocessor/keyword/= directory.
 [footnote
 This technique is at the core of even more complex preprocessor parsing macros like the ones that parse the __Contractpp__ syntax.
 ]

Modified: branches/release/libs/local_function/doc/introduction.qbk
==============================================================================
--- /trunk/libs/local_function/doc/introduction.qbk (original)
+++ branches/release/libs/local_function/doc/introduction.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,18 +5,18 @@
 [/ http://www.boost.org/LICENSE_1_0.txt) ]
 [/ Home at http://www.boost.org/libs/local_function ]
 
-[section:Introduction Introduction]
+[section Introduction]
 
-/Local functions/ are a form of /information hiding/ and they are useful for dividing procedural tasks into subtasks which are only meaningful locally, avoiding cluttering other parts of the program with functions, variables, etc unrelated to those parts.
-Local functions therefore complement other structuring possibilities such as namespaces and classes.
-Local functions are a feature of many programming languages, notably [@http://en.wikipedia.org/wiki/Nested_function#An_example Pascal] and [@http://en.wikipedia.org/wiki/Nesting_(computing)#In_programming Ada], yet lacking from __CPP03__ (see also __N2511__).
+/Local functions/ (a.k.a., [@http://en.wikipedia.org/wiki/Nested_function /nested functions/]) are a form of /information hiding/ and they are useful for dividing procedural tasks into subtasks which are only meaningful locally, avoiding cluttering other parts of the program with functions, variables, etc unrelated to those parts.
+Therefore, local functions complement other structuring possibilities such as namespaces and classes.
+Local functions are a feature of many programming languages, notably [@http://en.wikipedia.org/wiki/Nested_function#An_example Pascal] and [@http://en.wikipedia.org/wiki/Nesting_(computing)#In_programming Ada], yet lacking from __CXX03__ (see also __N2511__).
 
-Using __CPP11_lambda__ functions, it is possible to implement local functions by naming the lambdas assigning them to local variables.
-For example (see also [@../../test/add_lambda.cpp =add_lambda.cpp=]):
+Using __CXX11_lambda_functions__, it is possible to implement local functions by naming lambda functions assigning them to local variables.
+For example (see also [@../../example/add_cxx11_lambda.cpp =add_cxx11_lambda.cpp=]):
 
-[add_lambda]
+[add_cxx11_lambda]
 
-This library allows to program local functions portably between __CPP03__ and __CPP11__ (and with performances comparable to lambdas on __CPP11__ compilers, see the __Alternatives__ section).
+This library allows to program local functions portably between __CXX03__ and __CXX11__ (and with performances comparable to lambda functions on __CXX11__ compilers).
 For example (see also [@../../test/add.cpp =add.cpp=]):
 
 [add]
@@ -25,16 +25,16 @@
 
 * Local functions can capture, or better [@http://en.wikipedia.org/wiki/Name_binding /bind/], any of the variables from the enclosing scope (a function together with its captured variables is also called a [@http://en.wikipedia.org/wiki/Closure_(computer_science) /closure/]).
 * The local function body is programmed using the usual C++ statement syntax (as a consequence, compiler errors and debugging retain their usual meaning and format).
-* Local functions can be passed as template parameters so they can be conveniently used with STL algorithms, etc.
+* Local functions can be passed as template parameters so they can be conveniently used with STL algorithms and other templates.
 [footnote
-This is a strength with respect to __CPP03__ functors implemented using local classes which cannot be passed as template parameters (see __N2657__ and the __Alternatives__ section).
+This is a strength with respect to __CXX03__ functors implemented using local classes which cannot be passed as template parameters (see __N2657__ and the __Alternatives__ section).
 ]
 * However, local functions must be specified within a declarative context (e.g., at a point in the code where local variables can be declared) thus they cannot be specified within expressions.
 [footnote
-This is a weakness with respect to __CPP11_lambda__ functions which can instead be specified also within expressions (see the __Alternatives__ section).
+This is a weakness with respect to __CXX11_lambda_functions__ which can instead be specified also within expressions (see the __Alternatives__ section).
 ]
 
-See the __Alternatives__ section for a comparison between this library, __CPP11_lambda__ functions, __Boost_Phoenix__, and other C++ techniques that implement features related to local functions.
+See the __Alternatives__ section for a comparison between this library, __CXX11_lambda_functions__, __Boost_Phoenix__, and other C++ techniques that implement features related to local functions.
 
 [endsect]
 

Modified: branches/release/libs/local_function/doc/local_function.qbk
==============================================================================
--- /trunk/libs/local_function/doc/local_function.qbk (original)
+++ branches/release/libs/local_function/doc/local_function.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -19,8 +19,8 @@
     [category Function Objects and Higher-Order Programming]
 ]
 
-[def __CPP03__ [@http://www.open-std.org/JTC1/SC22/WG21/docs/standards C++03]]
-[def __CPP11__ [@http://www.open-std.org/JTC1/SC22/WG21/ C++11]]
+[def __CXX03__ [@http://www.open-std.org/JTC1/SC22/WG21/docs/standards C++03]]
+[def __CXX11__ [@http://www.open-std.org/JTC1/SC22/WG21/ C++11]]
 [def __C99__ [@http://www.open-std.org/jtc1/sc22/wg14/www/projects#9899 C99]]
 [def __Boost__ [@http://www.boost.org Boost]]
 [def __Boost_LocalFunction__ [@http://www.boost.org/libs/local_function Boost.LocalFunction]]
@@ -38,7 +38,8 @@
 [def __Boost_TypeTraits__ [@http://www.boost.org/libs/type_traits Boost.TypeTraits]]
 [def __Boost_Utility_IdentityType__ [@http://www.boost.org/libs/utility/identity_type Boost.Utility/IdentityType]]
 [def __Boost_Chrono__ [@http://www.boost.org/libs/chrono Boost.Chrono]]
-[def __CPP11_lambda__ [@http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions C++11 lambda]]
+[def __Boost_Config__ [@http://www.boost.org/libs/chrono Boost.Config]]
+[def __CXX11_lambda_functions__ [@http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions C++11 lambda functions]]
 [def __LISP__ [@http://en.wikipedia.org/wiki/Lisp_(programming_language) LISP]]
 [def __Contractpp__ [@http://sourceforge.net/projects/contractpp Contract++]]
 [def __D_Programming_Language__ [@http://d.digitalmars.com D Programming Language]]
@@ -49,23 +50,22 @@
 [def __N2550__ [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2550.pdf \[N2550\]]]
 [def __N2657__ [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm \[N2657\]]]
 
-[def __Introduction__ [link boost_localfunction.Introduction Introduction]]
-[def __Getting_Started__ [link boost_localfunction.Getting_Started Getting Started]]
-[def __Tutorial__ [link boost_localfunction.Tutorial Tutorial]]
-[def __Advanced_Topics__ [link boost_localfunction.Advanced_Topics Advanced Topics]]
-[def __Examples__ [link boost_localfunction.Examples Examples]]
+[def __Introduction__ [link boost_localfunction.introduction Introduction]]
+[def __Getting_Started__ [link boost_localfunction.getting_started Getting Started]]
+[def __Tutorial__ [link boost_localfunction.tutorial Tutorial]]
+[def __Advanced_Topics__ [link boost_localfunction.advanced_topics Advanced Topics]]
+[def __Examples__ [link boost_localfunction.examples Examples]]
 [def __Reference__ [@reference.html Reference]]
-[def __Alternatives__ [link boost_localfunction.Alternatives Alternatives]]
-[def __No_Variadic_Macros__ [link boost_localfunction.No_Variadic_Macros No Variadic Macros]]
-[def __Implementation__ [link boost_localfunction.Implementation Implementation]]
-[def __Release_Notes__ [link boost_localfunction.Release_Notes Release Notes]]
-[def __Bibliography__ [link boost_localfunction.Bibliography Bibliography]]
-[def __Acknowledgments__ [link boost_localfunction.Acknowledgments Acknowledgments]]
+[def __Alternatives__ [link boost_localfunction.alternatives Alternatives]]
+[def __No_Variadic_Macros__ [link boost_localfunction.no_variadic_macros No Variadic Macros]]
+[def __Implementation__ [link boost_localfunction.implementation Implementation]]
+[def __Release_Notes__ [link boost_localfunction.release_notes Release Notes]]
+[def __Bibliography__ [link boost_localfunction.bibliography Bibliography]]
+[def __Acknowledgments__ [link boost_localfunction.acknowledgments Acknowledgments]]
 
 [import ../test/add.cpp]
 [import ../test/add_seq.cpp]
-[import ../test/add_lambda.cpp]
-[import ../test/add_params.cpp]
+[import ../test/add_params_only.cpp]
 [import ../test/ten_void.cpp]
 [import ../test/add_this.cpp]
 [import ../test/add_template.cpp]
@@ -83,20 +83,25 @@
 [import ../test/overload.cpp]
 [import ../test/add_except.cpp]
 [import ../test/add_classifiers.cpp]
-[import ../test/operator_err.cpp]
-[import ../test/goto_err.cpp]
-[import ../test/seq.cpp]
+[import ../test/operator_error.cpp]
+[import ../test/goto.cpp]
+[import ../test/goto_error.cpp]
+[import ../test/same_line.cpp]
 
+[import ../example/add_cxx11_lambda.cpp]
+[import ../example/gcc_lambda.hpp]
 [import ../example/gcc_lambda.cpp]
-[import ../example/gcc_lambda_cpp11.cpp]
-[import ../example/const_block_err.cpp]
-[import ../example/scope_exit.cpp]
+[import ../example/gcc_cxx11_lambda.cpp]
+[import ../example/const_block.hpp]
+[import ../example/const_block_error.cpp]
+[import ../example/const_block_error_cxx11_lambda.cpp]
 [import ../example/scope_exit.hpp]
+[import ../example/scope_exit.cpp]
 [import ../example/phoenix_factorial_local.cpp]
 [import ../example/phoenix_factorial.cpp]
-[import ../example/noncopyable_lambda_err.cpp]
+[import ../example/noncopyable_cxx11_lambda_error.cpp]
 [import ../example/noncopyable_local_function.cpp]
-[import ../example/expensive_copy_lambda.cpp]
+[import ../example/expensive_copy_cxx11_lambda.cpp]
 [import ../example/expensive_copy_local_function.cpp]
 [import ../example/add_local_functor.cpp]
 [import ../example/add_global_functor.cpp]
@@ -104,17 +109,17 @@
 [import ../example/impl_tparam_tricks.cpp]
 [import ../example/impl_pp_keyword.cpp]
 
-This library allows to program functions locally, directly within the scope where they are needed.
+This library allows to program functions locally, within other functions, and directly within the scope where they are needed.
 
 [include introduction.qbk]
 [include getting_started.qbk]
 [include tutorial.qbk]
 [include advanced_topics.qbk]
 [include examples.qbk]
-[xinclude reference.xml]
 [include alternatives.qbk]
 [include no_variadic_macros.qbk]
 [include implementation.qbk]
+[xinclude reference.xml]
 [include release_notes.qbk]
 [include bibliography.qbk]
 [include acknowledgements.qbk]

Modified: branches/release/libs/local_function/doc/no_variadic_macros.qbk
==============================================================================
--- /trunk/libs/local_function/doc/no_variadic_macros.qbk (original)
+++ branches/release/libs/local_function/doc/no_variadic_macros.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,13 +5,13 @@
 [/ http://www.boost.org/LICENSE_1_0.txt) ]
 [/ Home at http://www.boost.org/libs/local_function ]
 
-[section:No_Variadic_Macros Annex: No Variadic Macros]
+[section:no_variadic_macros Annex: No Variadic Macros]
 
 This section illustrates an alternative syntax for compilers without variadic macro support.
 
-[h5 Sequence Syntax]
+[heading Sequence Syntax]
 
-Most modern compilers support [@http://en.wikipedia.org/wiki/Variadic_macro variaid macros] (notably, these include GCC, MSVC, and all __CPP11__ compilers).
+Most modern compilers support [@http://en.wikipedia.org/wiki/Variadic_macro variaid macros] (notably, these include GCC, MSVC, and all __CXX11__ compilers).
 However, in the rare case that programmers need to use this library on a compiler without variadic macros, this library also allows to specify its macro parameters using a __Boost_Preprocessor__ sequence where tokens are separated by round parenthesis `()`:
 
     (token1) (token2) ... // All compilers.
@@ -28,16 +28,41 @@
 
 [add]
 
-Note how the same macros accept both syntaxes on compilers with variadic macros and only the sequence syntax on compilers without variadic macros.
-Finally, an parameter list is always specified using `void` on compilers with and without variadic macros:
+Note that the same macros accept both syntaxes on compilers with variadic macros and only the sequence syntax on compilers without variadic macros.
+Finally, an empty local function parameter list is always specified using `void` on compilers with and without variadic macros:
 
 [ten_void]
 
-[h5 An Example]
+[heading Examples]
 
-The following example shows a bit of all the different macro parameter combinations using the sequence syntax (see also [@../../test/seq.cpp =seq.cpp=]):
+For reference, the following is a list of most of the examples presented in this documentation reprogrammed using the sequence syntax instead of the comma-separated syntax (in alphabetic order):
 
-[seq]
+[table
+ [ [Files] ]
+ [ [[@../../test/add_classifiers_seq.cpp =add_classifiers_seq.cpp=]] ]
+ [ [[@../../test/add_default_seq.cpp =add_default_seq.cpp=]] ]
+ [ [[@../../test/add_except_seq.cpp =add_except_seq.cpp=]] ]
+ [ [[@../../test/add_inline_seq.cpp =add_inline_seq.cpp=]] ]
+ [ [[@../../test/add_params_only_seq.cpp =add_params_only_seq.cpp=]] ]
+ [ [[@../../test/add_template_seq.cpp =add_template_seq.cpp=]] ]
+ [ [[@../../test/add_this_seq.cpp =add_this_seq.cpp=]] ]
+ [ [[@../../test/add_typed_seq.cpp =add_typed_seq.cpp=]] ]
+ [ [[@../../test/add_with_default_seq.cpp =add_with_default_seq.cpp=]] ]
+ [ [[@../../test/all_decl_seq.cpp =all_decl_seq.cpp=]] ]
+ [ [[@../../test/factorial_seq.cpp =factorial_seq.cpp=]] ]
+ [ [[@../../test/macro_commas_seq.cpp =macro_commas_seq.cpp=]] ]
+ [ [[@../../test/nesting_seq.cpp =nesting_seq.cpp=]] ]
+ [ [[@../../test/overload_seq.cpp =overload_seq.cpp=]] ]
+ [ [[@../../test/return_assign_seq.cpp =return_assign_seq.cpp=]] ]
+ [ [[@../../test/return_derivative_seq.cpp =return_derivative_seq.cpp=]] ]
+ [ [[@../../test/return_inc_seq.cpp =return_inc_seq.cpp=]] ]
+ [ [[@../../test/return_setget_seq.cpp =return_setget_seq.cpp=]] ]
+ [ [[@../../test/return_this_seq.cpp =return_this_seq.cpp=]] ]
+ [ [[@../../test/same_line_seq.cpp =same_line_seq.cpp=]] ]
+ [ [[@../../test/transform_seq.cpp =transform_seq.cpp=]] ]
+ [ [[@../../test/typeof_seq.cpp =typeof_seq.cpp=]] ]
+ [ [[@../../test/typeof_template_seq.cpp =typeof_template_seq.cpp=]] ]
+]
 
 [endsect]
 

Modified: branches/release/libs/local_function/doc/release_notes.qbk
==============================================================================
--- /trunk/libs/local_function/doc/release_notes.qbk (original)
+++ branches/release/libs/local_function/doc/release_notes.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,11 +5,11 @@
 [/ http://www.boost.org/LICENSE_1_0.txt) ]
 [/ Home at http://www.boost.org/libs/local_function ]
 
-[section:Release_Notes Release Notes]
+[section Release Notes]
 
 This section lists the major changes between different library releases (in chronological order).
 
-[h5 Version 1.0.0 (2012-01-31)]
+[heading Version 1.0.0 (2012-04-12)]
 
 # Incorporated all comments from the [@http://lists.boost.org/boost-announce/2011/12/0340.php Boost review of this library].
 # Removed local blocks and local exits.
@@ -19,8 +19,11 @@
 # Added GCC lambda and constant block examples.
 # Moved `overloaded_function` to Boost.Functional/OverloadedFunction.
 # Moved `BOOST_IDENTITY_TYPE` to Boost.Utility/IdentityType.
+# Completely removed use of Boost.Typeof when bound and result types are explicitly specified.
+# Added `..._ID` macros for multiple expansions on the same line.
+# Fixed compilation on Boost regression test platforms.
 
-[h5 Version 0.2.0 (2011-05-14)]
+[heading Version 0.2.0 (2011-05-14)]
 
 # Replaced parenthesized syntax with variadic and sequencing macro syntaxes.
 # Profiled library performances against other approaches.
@@ -33,17 +36,17 @@
 # Added functor to overload local functions (and functors in general).
 # Implemented support for nesting local functions, blocks, and exits into one another.
 
-[h5 Version 0.1.1 (2011-01-10)]
+[heading Version 0.1.1 (2011-01-10)]
 
 # Uploaded library source into Boost SVN sandbox.
 # Fixed prev/next arrows and other minor layouts in documentation.
 # Added Release section to documentation.
 
-[h5 Version 0.1.0 (2011-01-03)]
+[heading Version 0.1.0 (2011-01-03)]
 
 # Shared with Boost for first round of comments.
 
-[h5 Version 0.0.1 (2010-12-15)]
+[heading Version 0.0.1 (2010-12-15)]
 
 # Completed development, examples, and documentation.
 

Modified: branches/release/libs/local_function/doc/tutorial.qbk
==============================================================================
--- /trunk/libs/local_function/doc/tutorial.qbk (original)
+++ branches/release/libs/local_function/doc/tutorial.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,14 +5,14 @@
 [/ http://www.boost.org/LICENSE_1_0.txt) ]
 [/ Home at http://www.boost.org/libs/local_function ]
 
-[section:Tutorial Tutorial]
+[section Tutorial]
 
-This section illustrates basic usages of this library.
+This section illustrates basic usage of this library.
 
 [section Local Functions]
 
 Local functions are defined using macros from the header file [headerref boost/local_function.hpp].
-The macros must be used from within a declarative context (this is a limitation with respect to __CPP11_lambda__ functions which can instead be declared also within expressions):
+The macros must be used from within a declarative context (this is a limitation with respect to __CXX11_lambda_functions__ which can instead be declared also within expressions):
 
     #include <boost/local_function.hpp> // This library header.
 
@@ -33,7 +33,9 @@
 ]
 The usual C++ scope visibility rules apply to local functions for which a local function is visible only within the enclosing scope in which it is declared.
 
-The local function body is specified in a code block `{ ... }` using the usual C++ syntax.
+The local function result type is specified just before the [macroref BOOST_LOCAL_FUNCTION] macro.
+
+The local function body is specified using the usual C++ statement syntax in a code block `{ ... }` between the [macroref BOOST_LOCAL_FUNCTION] and [macroref BOOST_LOCAL_FUNCTION_NAME] macros.
 The body is specified outside any of the macros so eventual compiler error messages and related line numbers retain their usual meaning and format.
 [footnote
 *Rationale.*
@@ -46,14 +48,14 @@
     BOOST_LOCAL_FUNCTION(``[^/parameter-type1 parameter-name1/]``,`` [^/parameter-type2 parameter-name2, .../]``)
 
 The maximum number of parameters that can be passed to a local function is controlled at compile-time by the configuration macro [macroref BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX].
-For example, let's program a local function named `add` that adds together two integers `x` and `y` (see also [@../../test/add_params.cpp =add_params.cpp=]):
+For example, let's program a local function named `add` that adds together two integers `x` and `y` (see also [@../../test/add_params_only.cpp =add_params_only.cpp=]):
 
-[add_params]
+[add_params_only]
 
-If the local function has no parameter, it is possible to pass `void` to the [macroref BOOST_LOCAL_FUNCTION] macro (similarly to the C syntax that allows to use [^['result-type function-name]]`(void)` to declare a function with no parameter):
+If the local function has no parameter, it is possible to pass `void` to the [macroref BOOST_LOCAL_FUNCTION] macro (similarly to the C++ syntax that allows to use [^['result-type function-name]]`(void)` to declare a function with no parameter):
 [footnote
 *Rationale.*
-The __CPP03__ standard does not allow to pass empty parameters to a macro so the macro cannot be invoked as `BOOST_LOCAL_FUNCTION()`.
+The __CXX03__ standard does not allow to pass empty parameters to a macro so the macro cannot be invoked as `BOOST_LOCAL_FUNCTION()`.
 On __C99__ compilers with properly implemented empty macro parameter support, it would be possible to allow `BOOST_LOCAL_FUNCTION()` but this is already not the case for MSVC so this syntax is never allowed to ensure better portability.
 ]
 
@@ -67,9 +69,9 @@
 
 [section:Binding Binding Variables]
 
-Variables in scope (local variables, enclosing function parameters, member variables, etc) can be bound to a local function declaration.
+Variables in scope (local variables, enclosing function parameters, data members, etc) can be bound to a local function declaration.
 Only bound variables, static variables, global variables, functions, and enumerations from the enclosing scope are accessible from within the local function body.
-The types of bound variables are deduced automatically by this library.
+The types of bound variables are deduced automatically by this library using __Boost_Typeof__.
 [footnote
 *Rationale.*
 By binding a variable in scope, the local function declaration is specifying that such a variable should be accessible within the local function body regardless of its type.
@@ -78,11 +80,6 @@
 For example, this reduces maintenance because if a bound variable type is changed, the local function declaration does not have to change.
 ]
 
-[important
-The library implementation uses __Boost_Typeof__ to automatically deduce the types of the bound variables.
-Therefore, in order to compile code in type-of emulation mode, all types should be properly registered with `BOOST_TYPEOF_REGISTER_TYPE` or `BOOST_TYPEOF_REGISTER_TEMPLATE` macros, or appropriate __Boost_Typeof__ headers should be included (see the __Boost_Typeof__ documentation for more detail).
-]
-
 This library introduces the new "keyword" `bind`
 [footnote
 Obviously, the token `bind` is not a keyword of the C++ language.
@@ -110,18 +107,18 @@
 [footnote
 *Rationale.*
 The library macros could have been implemented to accept both syntaxes `const bind ...` and `bind const ...` equivalently.
-However, handling both syntaxes would have complicated the macro implementation without adding any feature so only one syntax (`const bind ...`) is supported.
+However, handling both syntaxes would have complicated the macro implementation without adding any feature so only one syntax `const bind ...` is supported.
 ]
     
 If a variable is bound by value, then a copy of the variable value is taken at the point of the local function declaration.
 If a variable is bound by reference instead, the variable will refer to the value it has at the point of the local function call.
 Furthermore, it is the programmers' responsibility to ensure that variables bound by reference survive the existence scope of the local function otherwise the bound references will be invalid when the local function is called resulting in undefined behaviour (in other words, the usual care in using C++ references must be taken for variables bound by reference).
 
-The type of a bound variable is automatically deduced and it is the exact same type used to declare such a variable in the enclosing scope with the following notes:
+The type of a bound variable is automatically deduced using __Boost_Typeof__ and it is the exact same type used to declare such a variable in the enclosing scope with the following notes:
 
 * If a bound variable was declared constant in the enclosing scope, it will always be bound by constant value or constant reference even if `bind...` is used instead of `const bind...` .
 However, if a bound variable was not declared constant in the enclosing scope then it will not be bound as constant unless constant binding is forced using `const bind...`.
-(Note that binding by constant reference is not supported by __CPP11_lambda__ functions but it is supported by this library.)
+(Note that binding by constant reference is not supported by __CXX11_lambda_functions__ but it is supported by this library.)
 [footnote
 An historical note: Constant binding of variables in scope was the main use case that originally motivated the authors in developing this library.
 The authors needed to locally create a chuck of code to assert some correctness conditions while these assertions were not supposed to modify any of the variables they were using (see the __Contractpp__ library).
@@ -132,10 +129,10 @@
 [footnote
 *Rationale.*
 Variables originally declared as references are bound by value unless `[const] bind&` is used so that references can be bound by both value `[const] bind` and reference `[const] bind&` (this is the same binding semantic adopted by __Boost_ScopeExit__).
-On the other hand, variables originally declared as constants should never loose their `const` qualifier (to prevent their modification not just in the enclosing scope but also in the local scope) thus they are always bound by constant even if `bind[&]` is used instead of `const bind[&]`.
+However, variables originally declared as constants should never loose their `const` qualifier (to prevent their modification not just in the enclosing scope but also in the local scope) thus they are always bound by constant even if `bind[&]` is used instead of `const bind[&]`.
 ]
 
-When a variable is bound by value (constant or not), its type must be `CopyConstructible` (i.e., its must provide a copy constructor).
+When a variable is bound by value (constant or not), its type must be [@http://www.boost.org/doc/libs/release/doc/html/CopyConstructible.html `CopyConstructible`] (i.e., its must provide a copy constructor).
 As with passing parameters to usual C++ functions, programmers might want to bind variables of complex types by (possibly constant) reference instead of by value to avoid expensive copy operations when these variables are bound to a local function.
 
 For example, let's program the local function `add` from the example in the __Introduction__ section.
@@ -151,7 +148,7 @@
 This is done by using the special symbol `this_` (instead of `this`) as the name of the variable to bind in the local function declaration and also to access the object within the local function body.
 [footnote
 *Rationale.*
-The special name `this_` was chosen following [@http://boost.2283326.n4.nabble.com/local-this-or-this-td3423912.html Boost practises] which postfix with an underscore identifiers that are named after keywords (the C++ keyword `this` in this case).
+The special name `this_` was chosen following [@http://lists.boost.org/Archives/boost/2011/04/179729.php Boost practise] to postfix with an underscore identifiers that are named after keywords (the C++ keyword `this` in this case).
 The special symbol `this_` is needed because `this` is a reserved C++ keyword so it cannot be used as the name of the internal parameter that passes the bound object to the local function body.
 It would have been possible to use `this` (instead of `this_`) within the local function body either at the expenses of copying the bound object (which would introduce run-time overhead and also the stringent requirement that the bound object must have a deep copy constructor) or by relying on an [@http://groups.google.com/group/comp.lang.c++.moderated/browse_thread/thread/d3a86f27277f713b undefined behaviour of `static_cast`] (which might not work on all platforms at the cost of portability).
 ]
@@ -161,7 +158,7 @@
 However, mistakenly using `this` instead of `this_` to access the object within the local function body will leads to undefined behaviour and it will not necessarily generate a compile-time error.
 [footnote
 *Rationale.*
-The local function body cannot be a static member function of the local functor object in order to support recursion (because the local function name is specified by the [macroref BOOST_LOCAL_FUNCTION_NAME] macro only after the body so it must be made available via a functor member variable named after the local function and local classes cannot have static member variables in C++) and nesting (because the argument binding variable must be declared as a member variable so it is visible in a local function nested within the body member function) -- see the __Implementation__ section.
+The local function body cannot be a static member function of the local functor object in order to support recursion (because the local function name is specified by the [macroref BOOST_LOCAL_FUNCTION_NAME] macro only after the body so it must be made available via a functor data member named after the local function and local classes cannot have static data members in C++) and nesting (because the argument binding variable must be declared as a data member so it is visible in a local function nested within the body member function) -- see the __Implementation__ section.
 Therefore, from within the local function body the variable `this` is visible but it refers to the local functor and not to the bound object.
 ]
 Programmers are ultimately responsible to make sure that `this` is never used within a local function.
@@ -190,17 +187,19 @@
 *Rationale.*
 This is possible because of the fix to C++ [@http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#45 defect 45] that made inner and local types able to access all outer class members regardless of their access level.
 ]
-Specifically, in the example above the local function updates the `private` data member `sum_`.
+Specifically, in the example above the local function updates the private data member `sum_`.
 
 [endsect]
 
 [section Templates]
 
-When local functions are programmed within templates, they need to be declared using the special macro [macroref BOOST_LOCAL_FUNCTION_TPL]:
+When local functions are programmed within templates, they need to be declared using the special macros [macroref BOOST_LOCAL_FUNCTION_TPL] and [macroref BOOST_LOCAL_FUNCTION_NAME_TPL]:
 [footnote
 *Rationale.*
 Within templates, this library needs to use `typename` to explicitly indicate that some expressions evaluate to a type.
-Because __CPP03__ does not allow to use `typename` outside templates, the special `TPL` macro is used to indicate that the enclosing scope is a template so this library can safely use `typename` to resolve expression type ambiguities.
+Because __CXX03__ does not allow to use `typename` outside templates, the special `..._TPL` macros are used to indicate that the enclosing scope is a template so this library can safely use `typename` to resolve expression type ambiguities.
+__CXX11__ and other compilers might compile local functions within templates even when the `..._TPL` macros are not used.
+However, it is recommended to always use the `..._TPL` macros within templates to maximize portability.
 ]
 
     #include <boost/local_function.hpp> // This library header.
@@ -210,11 +209,11 @@
         ...
         ``/result-type/`` BOOST_LOCAL_FUNCTION_TPL(``/parameters/``) {
             ``/body-code/``
- } BOOST_LOCAL_FUNCTION_NAME(``/name/``)
+ } BOOST_LOCAL_FUNCTION_NAME_TPL(``/name/``)
         ...
     }
 
-The [macroref BOOST_LOCAL_FUNCTION_TPL] macro has the exact same syntax of the [macroref BOOST_LOCAL_FUNCTION] macro that we have seen so far.
+The [macroref BOOST_LOCAL_FUNCTION_TPL] and [macroref BOOST_LOCAL_FUNCTION_NAME_TPL] macros have the exact same syntax of the [macroref BOOST_LOCAL_FUNCTION] and [macroref BOOST_LOCAL_FUNCTION_NAME] macros that we have seen so far.
 
 For example, let's program a local function similar to the one from the __Introduction__ section but within a template (see also [@../../test/add_template.cpp =add_template.cpp=]):
 

Modified: branches/release/libs/local_function/example/Jamfile.v2
==============================================================================
--- /trunk/libs/local_function/example/Jamfile.v2 (original)
+++ branches/release/libs/local_function/example/Jamfile.v2 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,23 +7,25 @@
 
 import testing ;
 
-project : requirements <library>/boost//unit_test_framework ;
+# Sun does not automatically detect type-of emulation mode (force it).
+project : requirements <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
 
+run add_cxx11_lambda.cpp ;
 run add_global_functor.cpp ;
 run add_local_functor.cpp ;
-# I'm not sure why this does not compile... I've asked Booster.
-#run add_phoenix.cpp ;
+run add_phoenix.cpp ;
 
 run const_block.cpp ;
-# Compilation fails for debug but not for release builds so commented out.
-#compile-fail const_block_err.cpp ;
+compile-fail const_block_error.cpp : <variant>debug : ;
+run const_block_error.cpp : <variant>release : ;
+compile-fail const_block_error_cxx11_lambda.cpp ;
 
-run expensive_copy_lambda.cpp ;
+run expensive_copy_cxx11_lambda.cpp ;
 run expensive_copy_local_function.cpp ;
 
 run gcc_access.cpp ;
 run gcc_lambda.cpp ;
-run gcc_lambda_cpp11.cpp ;
+run gcc_cxx11_lambda.cpp ;
 run gcc_square.cpp ;
 run gcc_store.cpp ;
 
@@ -33,18 +35,19 @@
 run n2529_this.cpp ;
 run n2550_find_if.cpp ;
 
-compile-fail noncopyable_lambda_err.cpp ;
+compile-fail noncopyable_cxx11_lambda_error.cpp ;
 run noncopyable_local_function.cpp ;
 
 run phoenix_factorial.cpp ;
 run phoenix_factorial_local.cpp ;
 
+# Only compile but do not run profiling programs (they take a long time to run).
 exe profile_global_functor : profile_global_functor.cpp
     : <library>/boost/chrono//boost_chrono
         <library>/boost/system//boost_system
         <link>static
     ;
-exe profile_lambda : profile_lambda.cpp
+exe profile_cxx11_lambda : profile_cxx11_lambda.cpp
     : <library>/boost/chrono//boost_chrono
         <library>/boost/system//boost_system
         <link>static

Modified: branches/release/libs/local_function/example/add_global_functor.cpp
==============================================================================
--- /trunk/libs/local_function/example/add_global_functor.cpp (original)
+++ branches/release/libs/local_function/example/add_global_functor.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,8 +5,7 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
-#define BOOST_TEST_MODULE TestAddGlobalFunctor
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 
 //[add_global_functor
@@ -17,12 +16,13 @@
     inline void operator()(int num) { // Body uses C++ statement syntax.
         sum += factor * num;
     }
+
 private: // Unfortunately, cannot bind so repeat variable types.
     int& sum; // Access `sum` by reference.
     const int factor; // Make `factor` constant.
 };
 
-BOOST_AUTO_TEST_CASE( test_add_global_functor ) {
+int main(void) {
     int sum = 0, factor = 10;
 
     global_add add(sum, factor);
@@ -31,7 +31,8 @@
     int nums[] = {2, 3};
     std::for_each(nums, nums + 2, add); // Passed as template parameter.
 
- BOOST_CHECK( sum == 60 );
+ BOOST_TEST(sum == 60);
+ return boost::report_errors();
 }
 //]
 

Modified: branches/release/libs/local_function/example/add_local_functor.cpp
==============================================================================
--- /trunk/libs/local_function/example/add_local_functor.cpp (original)
+++ branches/release/libs/local_function/example/add_local_functor.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,12 +5,10 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
-#define BOOST_TEST_MODULE TestAddLocalFunctor
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE( test_add_local_functor )
 //[add_local_functor
-{
+int main(void) {
     int sum = 0, factor = 10;
 
     struct local_add { // Unfortunately, boilerplate code to program the class.
@@ -19,6 +17,7 @@
         inline void operator()(int num) { // Body uses C++ statement syntax.
             sum += factor * num;
         }
+
     private: // Unfortunately, cannot bind so repeat variable types.
         int& sum; // Access `sum` by reference.
         const int factor; // Make `factor` constant.
@@ -29,7 +28,8 @@
     // Unfortunately, cannot pass as template parameter to `std::for_each`.
     for(size_t i = 0; i < 2; ++i) add(nums[i]);
 
- BOOST_CHECK( sum == 60 );
+ BOOST_TEST(sum == 60);
+ return boost::report_errors();
 }
 //]
 

Modified: branches/release/libs/local_function/example/add_phoenix.cpp
==============================================================================
--- /trunk/libs/local_function/example/add_phoenix.cpp (original)
+++ branches/release/libs/local_function/example/add_phoenix.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,14 +6,12 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/spirit/include/phoenix.hpp>
-#define BOOST_TEST_MODULE TestAddPhoenix
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 #include <iostream>
     
-BOOST_AUTO_TEST_CASE( test_add_phoenix )
 //[add_phoenix
-{
+int main(void) {
     using boost::phoenix::let;
     using boost::phoenix::local_names::_f;
     using boost::phoenix::cref;
@@ -26,10 +24,11 @@
     // Passed to template, `factor` by constant, and defined in expression.
     std::for_each(nums, nums + 3, let(_f = cref(factor))[
         // Unfortunately, body cannot use C++ statement syntax.
- ref(sum) += _f * _1 // Access `sum` by reference.
+ ref(sum) += _f * _1, _1 // Access `sum` by reference.
     ]);
 
- BOOST_CHECK( sum == 60 );
+ BOOST_TEST(sum == 60);
+ return boost::report_errors();
 }
 //]
 

Modified: branches/release/libs/local_function/example/chrono.py
==============================================================================
--- /trunk/libs/local_function/example/chrono.py (original)
+++ branches/release/libs/local_function/example/chrono.py 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -9,7 +9,10 @@
 import time
 import os
 
-# Usage: python crono.py COMMAND [COMMAND_OPTIONS]
+if len(sys.argv) < 2:
+ print "Usage: python " + sys.argv[0] + " COMMAND [COMMAND_OPTIONS]"
+ print "Measure run-time of executing the specified command."
+ exit(1)
 
 cmd = ""
 for arg in sys.argv[1:]: cmd += str(arg) + " "

Modified: branches/release/libs/local_function/example/const_block.hpp
==============================================================================
--- /trunk/libs/local_function/example/const_block.hpp (original)
+++ branches/release/libs/local_function/example/const_block.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -17,25 +17,28 @@
 #include <boost/preprocessor/punctuation/comma_if.hpp>
 #include <boost/preprocessor/control/iif.hpp>
 #include <boost/preprocessor/cat.hpp>
-#include <cassert>
 
 // PRIVATE //
 
 #define CONST_BLOCK_BIND_(r, unused, i, var) \
     BOOST_PP_COMMA_IF(i) const bind& var
     
-#define CONST_BLOCK_(list) \
+//[const_block_macro
+#define CONST_BLOCK_(variables) \
     void BOOST_LOCAL_FUNCTION( \
- BOOST_PP_IIF(BOOST_PP_LIST_IS_NIL(list), \
+ BOOST_PP_IIF(BOOST_PP_LIST_IS_NIL(variables), \
             void BOOST_PP_TUPLE_EAT(3) \
         , \
             BOOST_PP_LIST_FOR_EACH_I \
- )(CONST_BLOCK_BIND_, ~, list) \
+ )(CONST_BLOCK_BIND_, ~, variables) \
     )
+//]
 
+//[const_block_end_macro
 #define CONST_BLOCK_END_(id) \
- BOOST_LOCAL_FUNCTION_NAME(BOOST_PP_CAT(const_assert_, id)) \
- BOOST_PP_CAT(const_assert_, id)(); /* call local function immediately */
+ BOOST_LOCAL_FUNCTION_NAME(BOOST_PP_CAT(const_block_, id)) \
+ BOOST_PP_CAT(const_block_, id)(); /* call local function immediately */
+//]
 
 // PUBLIC //
 

Deleted: /trunk/libs/local_function/example/const_block_err.cpp
==============================================================================
--- /trunk/libs/local_function/example/const_block_err.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,20 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/local_function
-
-#include "const_block.hpp"
-#include <cassert>
-
-int main(void) {
- //[const_block
- int x = 1, y = 2;
- CONST_BLOCK(x, y) { // Constant block.
- assert(x = y); // Compiler error.
- } CONST_BLOCK_END
- //]
- return 0;
-}
-

Copied: branches/release/libs/local_function/example/expensive_copy_cxx11_lambda.cpp (from r77830, /trunk/libs/local_function/example/expensive_copy_cxx11_lambda.cpp)
==============================================================================
--- /trunk/libs/local_function/example/expensive_copy_cxx11_lambda.cpp (original)
+++ branches/release/libs/local_function/example/expensive_copy_cxx11_lambda.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -22,6 +22,7 @@
     }
 };
 
+
 int main(void) {
     n x(-1);
 

Deleted: /trunk/libs/local_function/example/expensive_copy_lambda.cpp
==============================================================================
--- /trunk/libs/local_function/example/expensive_copy_lambda.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,40 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/local_function
-
-#include <boost/config.hpp>
-#ifndef BOOST_NO_LAMBDAS
-
-#include <iostream>
-#include <cassert>
-
-//[expensive_copy_lambda
-struct n {
- int i;
- n(int _i): i(_i) {}
- n(n const& x): i(x.i) { // Some time consuming copy.
- for (unsigned i = 0; i < 10000; ++i) std::cout << '.';
- }
-};
-
-int main(void) {
- n x(-1);
-
- auto f = [x]() { // Problem: Expensive copy, but if bind
- assert( x.i == -1); // by `&x` then `x` is not constant.
- };
- f();
-
- return 0;
-}
-//]
-
-#else // NO_LAMBDAS
-
-int main(void) { return 0; } // Trivial program.
-
-#endif // NO_LAMBDAS
-

Modified: branches/release/libs/local_function/example/expensive_copy_local_function.cpp
==============================================================================
--- /trunk/libs/local_function/example/expensive_copy_local_function.cpp (original)
+++ branches/release/libs/local_function/example/expensive_copy_local_function.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,6 +6,8 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
 #include <iostream>
 #include <cassert>
 
@@ -13,16 +15,17 @@
 struct n {
     int i;
     n(int _i): i(_i) {}
- n(n const& x): i(x.i) { // Some time consuming copy.
+ n(n const& x): i(x.i) { // Some time consuming copy operation.
         for (unsigned i = 0; i < 10000; ++i) std::cout << '.';
     }
 };
+BOOST_TYPEOF_REGISTER_TYPE(n) // Register for `bind& x` below.
 
 int main(void) {
     n x(-1);
 
- void BOOST_LOCAL_FUNCTION(const bind& x) { // OK: No copy
- assert( x.i == -1 ); // and constant.
+ void BOOST_LOCAL_FUNCTION(const bind& x) { // OK: No copy expensive
+ assert(x.i == -1); // copy but constant.
     } BOOST_LOCAL_FUNCTION_NAME(f)
     f();
 

Modified: branches/release/libs/local_function/example/gcc_access.cpp
==============================================================================
--- /trunk/libs/local_function/example/gcc_access.cpp (original)
+++ branches/release/libs/local_function/example/gcc_access.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,18 +6,18 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestGccAccess
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE( test_gcc_access ) {
+int main(void) {
     int nums[] = {1, 2, 3};
     int offset = -1;
     int BOOST_LOCAL_FUNCTION(const bind offset, int* array, int index) {
         return array[index + offset];
     } BOOST_LOCAL_FUNCTION_NAME(access)
 
- BOOST_CHECK( access(nums, 1) == 1 );
- BOOST_CHECK( access(nums, 2) == 2 );
- BOOST_CHECK( access(nums, 3) == 3 );
+ BOOST_TEST(access(nums, 1) == 1);
+ BOOST_TEST(access(nums, 2) == 2);
+ BOOST_TEST(access(nums, 3) == 3);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/example/gcc_lambda.cpp
==============================================================================
--- /trunk/libs/local_function/example/gcc_lambda.cpp (original)
+++ branches/release/libs/local_function/example/gcc_lambda.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,14 +6,15 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/config.hpp>
-#if defined(__GCC__) || !defined(BOOST_NO_LAMBDAS)
+#ifndef __GNUC__
+# error "GCC required (using non-standard GCC statement expressions)"
+#else
 
 #include "gcc_lambda.hpp"
-#define BOOST_TEST_MODULE TestGccLambda
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 
-BOOST_AUTO_TEST_CASE( test_gcc_lambda ) {
+int main(void) {
     //[gcc_lambda
     int val = 2;
     int nums[] = {1, 2, 3};
@@ -26,13 +27,10 @@
     );
     //]
 
- BOOST_CHECK( iter != end );
- BOOST_CHECK( *iter == val );
+ BOOST_TEST(iter != end);
+ BOOST_TEST(*iter == val);
+ return boost::report_errors();
 }
 
-#else // GCC || !NO_LAMBDAS
-
-int main(void) { return 0; }
-
-#endif // GCC || !NO_LAMBDAS
+#endif // GCC
 

Modified: branches/release/libs/local_function/example/gcc_lambda.hpp
==============================================================================
--- /trunk/libs/local_function/example/gcc_lambda.hpp (original)
+++ branches/release/libs/local_function/example/gcc_lambda.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -65,6 +65,7 @@
             BOOST_PP_LIST_FIRST(results))
 
 #ifdef BOOST_NO_LAMBDAS
+//[gcc_lambda_macro
 # define GCC_LAMBDA_(binds, params, results) \
         ({ /* open statement expression (GCC extension only) */ \
         BOOST_LOCAL_FUNCTION( \
@@ -78,6 +79,7 @@
                 ) \
             )) \
         )
+//]
 #else
 # define GCC_LAMBDA_(binds, params, results) \
         /* ignore const binding because not supported by C++11 lambdas */ \
@@ -95,10 +97,12 @@
             BOOST_PP_TUPLE_ELEM(3, 1, binds_params_results), \
             BOOST_PP_TUPLE_ELEM(3, 2, binds_params_results))
 
+//[gcc_lambda_end_macro
 #define GCC_LAMBDA_END_(id) \
     BOOST_LOCAL_FUNCTION_NAME(BOOST_PP_CAT(gcc_lambda_, id)) \
     BOOST_PP_CAT(gcc_lambda_, id); \
     }) /* close statement expression (GCC extension only) */
+//]
 
 // PUBLIC //
 

Deleted: /trunk/libs/local_function/example/gcc_lambda_cpp11.cpp
==============================================================================
--- /trunk/libs/local_function/example/gcc_lambda_cpp11.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,37 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/local_function
-
-#include <boost/config.hpp>
-#ifndef BOOST_NO_LAMBDAS
-
-#define BOOST_TEST_MODULE TestGccLambdaCpp11
-#include <boost/test/unit_test.hpp>
-#include <algorithm>
-
-BOOST_AUTO_TEST_CASE( test_gcc_lambda_cpp11 ) {
- //[gcc_lambda_cpp11
- int val = 2;
- int nums[] = {1, 2, 3};
- int* end = nums + 3;
-
- int* iter = std::find_if(nums, end,
- [val](int num) -> bool {
- return num == val;
- }
- );
- //]
-
- BOOST_CHECK( iter != end );
- BOOST_CHECK( *iter == val );
-}
-
-#else // NO_LAMBDAS
-
-int main(void) { return 0; } // Trivial test.
-
-#endif // NO_LAMBDAS
-

Modified: branches/release/libs/local_function/example/gcc_square.cpp
==============================================================================
--- /trunk/libs/local_function/example/gcc_square.cpp (original)
+++ branches/release/libs/local_function/example/gcc_square.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,18 +6,18 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestGccSquare
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-double add_square(double a, double b) {
- double BOOST_LOCAL_FUNCTION(double z) {
+int add_square(int a, int b) {
+ int BOOST_LOCAL_FUNCTION(int z) {
         return z * z;
     } BOOST_LOCAL_FUNCTION_NAME(square)
 
     return square(a) + square(b);
 }
 
-BOOST_AUTO_TEST_CASE( test_gcc_square ) {
- BOOST_CHECK( add_square(2.0, 4.0) == 20.0 );
+int main(void) {
+ BOOST_TEST(add_square(2, 4) == 20);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/example/gcc_store.cpp
==============================================================================
--- /trunk/libs/local_function/example/gcc_store.cpp (original)
+++ branches/release/libs/local_function/example/gcc_store.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,8 +7,7 @@
 
 #include <boost/local_function.hpp>
 #include <boost/function.hpp>
-#define BOOST_TEST_MODULE TestGccStore
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
 void intermediate(boost::function<void (int, int)> store_func, int size) {
     store_func(size - 1, -1);
@@ -22,12 +21,13 @@
     intermediate(store, size);
 }
 
-BOOST_AUTO_TEST_CASE( test_gcc_store ) {
+int main(void) {
     int nums[] = {1, 2, 3};
     hack(nums, 3);
 
- BOOST_CHECK( nums[0] == 1 );
- BOOST_CHECK( nums[1] == 2 );
- BOOST_CHECK( nums[2] == -1 );
+ BOOST_TEST(nums[0] == 1);
+ BOOST_TEST(nums[1] == 2);
+ BOOST_TEST(nums[2] == -1);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/example/impl_pp_keyword.cpp
==============================================================================
--- /trunk/libs/local_function/example/impl_pp_keyword.cpp (original)
+++ branches/release/libs/local_function/example/impl_pp_keyword.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -9,8 +9,7 @@
 #include <boost/local_function/detail/preprocessor/keyword/thisunderscore.hpp>
 #include <boost/local_function/detail/preprocessor/keyword/const.hpp>
 #include <boost/local_function/detail/preprocessor/keyword/bind.hpp>
-#define BOOST_TEST_MODULE TestImplPpKeyword
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
 // Expand to 1 if space-separated tokens end with `this_`, 0 otherwise.
 #define IS_THIS_BACK(tokens) \
@@ -20,9 +19,10 @@
         tokens \
     )))
 
-BOOST_AUTO_TEST_CASE( test_impl_pp_keyword ) {
- BOOST_CHECK( IS_THIS_BACK(const bind this_) == 1 );
- BOOST_CHECK( IS_THIS_BACK(const bind& x) == 0 );
+int main(void) {
+ BOOST_TEST(IS_THIS_BACK(const bind this_) == 1);
+ BOOST_TEST(IS_THIS_BACK(const bind& x) == 0);
+ return boost::report_errors();
 }
 //]
 

Modified: branches/release/libs/local_function/example/impl_tparam_tricks.cpp
==============================================================================
--- /trunk/libs/local_function/example/impl_tparam_tricks.cpp (original)
+++ branches/release/libs/local_function/example/impl_tparam_tricks.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,15 +6,14 @@
 // Home at http://www.boost.org/libs/local_function
 
 //[impl_tparam_tricks
-#define BOOST_TEST_MODULE TestImplTparamTricks
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 #include <algorithm>
 
 // Casting functor trick.
 struct casting_func {
- explicit casting_func(void* obj, void (*call)(void*, const int&)):
- obj_(obj), call_(call) {}
+ explicit casting_func(void* obj, void (*call)(void*, const int&))
+ : obj_(obj), call_(call) {}
     // Unfortunately, function pointer call is not inlined.
     inline void operator()(const int& num) { call_(obj_, num); }
 private:
@@ -34,18 +33,17 @@
     interface* func_;
 };
 
-BOOST_AUTO_TEST_CASE( test_impl_tparam_tricks ) {
+int main(void) {
     int sum = 0, factor = 10;
 
     // Local class for local function.
- struct local_add: virtual_func::interface {
- explicit local_add(int& _sum, const int& _factor):
- sum_(_sum), factor_(_factor) {}
+ struct local_add : virtual_func::interface {
+ explicit local_add(int& _sum, const int& _factor)
+ : sum_(_sum), factor_(_factor) {}
         inline void operator()(const int& num) {
             body(sum_, factor_, num);
         }
- inline static void call(
- void* obj, const int& num) {
+ inline static void call(void* obj, const int& num) {
             local_add* self = static_cast<local_add*>(obj);
             self->body(self->sum_, self->factor_, num);
         }
@@ -62,11 +60,12 @@
     std::vector<int> v(10);
     std::fill(v.begin(), v.end(), 1);
     
-// std::for_each(v.begin(), v.end(), add_local); // Error but OK on C++11.
+ // std::for_each(v.begin(), v.end(), add_local); // Error but OK on C++11.
     std::for_each(v.begin(), v.end(), add_casting); // OK.
     std::for_each(v.begin(), v.end(), add_virtual); // OK.
 
- BOOST_CHECK( sum == 200 );
+ BOOST_TEST(sum == 200);
+ return boost::report_errors();
 }
 //]
 

Modified: branches/release/libs/local_function/example/n2529_this.cpp
==============================================================================
--- /trunk/libs/local_function/example/n2529_this.cpp (original)
+++ branches/release/libs/local_function/example/n2529_this.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,11 +6,15 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestN2529This
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 #include <algorithm>
 
+struct v;
+BOOST_TYPEOF_REGISTER_TYPE(v) // Register before `bind this_` below.
+
 struct v {
     std::vector<int> nums;
     
@@ -25,7 +29,7 @@
     }
 };
 
-BOOST_AUTO_TEST_CASE( test_n2529_this ) {
+int main(void) {
     std::vector<int> n(3);
     n[0] = 1; n[1] = 2; n[2] = 3;
 
@@ -35,8 +39,9 @@
     v vn(n);
     vn.change_sign_all(i);
     
- BOOST_CHECK( vn.nums.at(0) == -1 );
- BOOST_CHECK( vn.nums.at(1) == 2 );
- BOOST_CHECK( vn.nums.at(2) == -3 );
+ BOOST_TEST(vn.nums.at(0) == -1);
+ BOOST_TEST(vn.nums.at(1) == 2);
+ BOOST_TEST(vn.nums.at(2) == -3);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/example/n2550_find_if.cpp
==============================================================================
--- /trunk/libs/local_function/example/n2550_find_if.cpp (original)
+++ branches/release/libs/local_function/example/n2550_find_if.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,8 +6,9 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestN2550FindIf
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 #include <algorithm>
 
@@ -15,10 +16,11 @@
     int salary;
     explicit employee(const int& a_salary): salary(a_salary) {}
 };
+BOOST_TYPEOF_REGISTER_TYPE(employee) // Register for `NAME` below.
 
-BOOST_AUTO_TEST_CASE( test_n2550_find_if ) {
+int main(void) {
     std::vector<employee> employees;
- employees.push_back(employee( 85000));
+ employees.push_back(employee(85000));
     employees.push_back(employee(100000));
     employees.push_back(employee(120000));
 
@@ -35,7 +37,8 @@
     std::vector<employee>::iterator i = std::find_if(
             employees.begin(), employees.end(), between);
 
- BOOST_CHECK( i != employees.end() );
- BOOST_CHECK( i->salary >= min_salary && i->salary < u_limit );
+ BOOST_TEST(i != employees.end());
+ BOOST_TEST(i->salary >= min_salary && i->salary < u_limit);
+ return boost::report_errors();
 }
 

Copied: branches/release/libs/local_function/example/noncopyable_cxx11_lambda_error.cpp (from r77830, /trunk/libs/local_function/example/noncopyable_cxx11_lambda_error.cpp)
==============================================================================
--- /trunk/libs/local_function/example/noncopyable_cxx11_lambda_error.cpp (original)
+++ branches/release/libs/local_function/example/noncopyable_cxx11_lambda_error.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -13,12 +13,13 @@
 #include <boost/noncopyable.hpp>
 #include <cassert>
 
-//[noncopyable_lambda_error
+//[noncopyable_cxx11_lambda_error
 struct n: boost::noncopyable {
     int i;
     n(int _i): i(_i) {}
 };
 
+
 int main(void) {
     n x(-1);
 

Deleted: /trunk/libs/local_function/example/noncopyable_lambda_err.cpp
==============================================================================
--- /trunk/libs/local_function/example/noncopyable_lambda_err.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,37 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/local_function
-
-#include <boost/config.hpp>
-#ifndef BOOST_NO_LAMBDAS
-
-#include <boost/noncopyable.hpp>
-#include <cassert>
-
-//[noncopyable_lambda_err
-struct n: boost::noncopyable {
- int i;
- n(int _i): i(_i) {}
-};
-
-int main(void) {
- n x(-1);
-
- auto f = [x](void) { // Error: x is non-copyable, but if
- assert( x.i == -1 ); // bind `&x` then `x` is not constant.
- };
- f();
-
- return 0;
-}
-//]
-
-#else // NO_LAMBDAS
-
-#error "Trivial failure."
-
-#endif // NO_LAMBDAS
-

Modified: branches/release/libs/local_function/example/noncopyable_local_function.cpp
==============================================================================
--- /trunk/libs/local_function/example/noncopyable_local_function.cpp (original)
+++ branches/release/libs/local_function/example/noncopyable_local_function.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,6 +7,8 @@
 
 #include <boost/local_function.hpp>
 #include <boost/noncopyable.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
 #include <cassert>
 
 //[noncopyable_local_function
@@ -14,12 +16,13 @@
     int i;
     n(int _i): i(_i) {}
 };
+BOOST_TYPEOF_REGISTER_TYPE(n) // Register for `bind& x` below.
 
-int main() {
+int main(void) {
     n x(-1);
 
     void BOOST_LOCAL_FUNCTION(const bind& x) { // OK: No copy
- assert( x.i == -1 ); // and constant.
+ assert(x.i == -1); // and constant.
     } BOOST_LOCAL_FUNCTION_NAME(f)
     f();
 

Modified: branches/release/libs/local_function/example/phoenix_factorial.cpp
==============================================================================
--- /trunk/libs/local_function/example/phoenix_factorial.cpp (original)
+++ branches/release/libs/local_function/example/phoenix_factorial.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,8 +7,7 @@
 
 #include <boost/phoenix/core.hpp>
 #include <boost/phoenix/function.hpp>
-#define BOOST_TEST_MODULE TestPhoenixFactorial
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
 //[phoenix_factorial
 struct factorial_impl { // Phoenix function from global functor.
@@ -27,14 +26,15 @@
     }
 };
 
-BOOST_AUTO_TEST_CASE( test_phoenix_factorial ) {
+int main(void) {
     using boost::phoenix::arg_names::arg1;
     
     boost::phoenix::function<factorial_impl> factorial;
     
     int i = 4;
- BOOST_CHECK( factorial(i)() == 24 ); // Call.
- BOOST_CHECK( factorial(arg1)(i) == 24 ); // Lazy call.
+ BOOST_TEST(factorial(i)() == 24); // Call.
+ BOOST_TEST(factorial(arg1)(i) == 24); // Lazy call.
+ return boost::report_errors();
 }
 //]
 

Modified: branches/release/libs/local_function/example/phoenix_factorial_local.cpp
==============================================================================
--- /trunk/libs/local_function/example/phoenix_factorial_local.cpp (original)
+++ branches/release/libs/local_function/example/phoenix_factorial_local.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -9,11 +9,10 @@
 #include <boost/function.hpp>
 #include <boost/phoenix/core.hpp>
 #include <boost/phoenix/function.hpp>
-#define BOOST_TEST_MODULE TestPhoenixFactorialLocal
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
 //[phoenix_factorial_local
-BOOST_AUTO_TEST_CASE( test_phoenix_factorial_local ) {
+int main(void) {
     using boost::phoenix::arg_names::arg1;
     
     int BOOST_LOCAL_FUNCTION(int n) { // Unfortunately, monomorphic.
@@ -24,8 +23,9 @@
             factorial(factorial_impl); // Phoenix function from local function.
     
     int i = 4;
- BOOST_CHECK( factorial(i)() == 24 ); // Call.
- BOOST_CHECK( factorial(arg1)(i) == 24 ); // Lazy call.
+ BOOST_TEST(factorial(i)() == 24); // Call.
+ BOOST_TEST(factorial(arg1)(i) == 24); // Lazy call.
+ return boost::report_errors();
 }
 //]
 

Deleted: /trunk/libs/local_function/example/profile_gcc_cpp11_debug.png
==============================================================================
Binary file. No diff available.

Deleted: /trunk/libs/local_function/example/profile_gcc_cpp11_release.png
==============================================================================
Binary file. No diff available.

Deleted: /trunk/libs/local_function/example/profile_lambda.cpp
==============================================================================
--- /trunk/libs/local_function/example/profile_lambda.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,46 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/local_function
-
-#include <boost/config.hpp>
-#ifndef BOOST_NO_LAMBDAS
-
-#include <boost/chrono.hpp>
-#include <vector>
-#include <algorithm>
-#include <iostream>
-#include "profile_helpers.hpp"
-
-int main(int argc, char* argv[]) {
- unsigned long size = 0, trials = 0;
- profile::args(argc, argv, size, trials);
-
- double sum = 0.0;
- int factor = 1;
-
- std::vector<double> v(size);
- std::fill(v.begin(), v.end(), 1.0);
-
- boost::chrono::duration<double> trials_sec;
- for(unsigned long i = 0; i < trials; ++i) {
- boost::chrono::system_clock::time_point start =
- boost::chrono::system_clock::now();
- std::for_each(v.begin(), v.end(), [&sum, factor](const double& num) {
- sum += factor * num;
- });
- trials_sec += boost::chrono::system_clock::now() - start;
- }
-
- profile::display(size, trials, sum, trials_sec.count());
- return 0;
-}
-
-#else // NO_LAMBDAS
-
-int main(void) { return 0; } // Trivial program.
-
-#endif // NO_LAMBDAS
-

Deleted: /trunk/libs/local_function/example/profile_legend_lambda.png
==============================================================================
Binary file. No diff available.

Modified: branches/release/libs/local_function/example/scope_exit.cpp
==============================================================================
--- /trunk/libs/local_function/example/scope_exit.cpp (original)
+++ branches/release/libs/local_function/example/scope_exit.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -10,13 +10,11 @@
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/vector.hpp>
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestScopeExit
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 #include <iostream>
 #include <sstream>
 
-class person; BOOST_TYPEOF_REGISTER_TYPE(person)
 class person {
     friend class world;
 public:
@@ -32,8 +30,8 @@
     id_t id_;
     evolution_t evolution_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(person)
 
-class world; BOOST_TYPEOF_REGISTER_TYPE(world)
 class world {
 public:
     typedef unsigned int id_t;
@@ -53,6 +51,7 @@
     id_t next_id_;
     std::vector<person> persons_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(world)
 
 void world::add_person(person const& a_person) {
     persons_.push_back(a_person);
@@ -87,17 +86,17 @@
     checkpoint = ++p.evolution_;
 }
 
-BOOST_AUTO_TEST_CASE( test_scope_exit ) {
+int main(void) {
     person adam, eva;
     std::ostringstream oss;
     oss << adam;
     std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "person(0, 0)" );
+ BOOST_TEST(oss.str() == "person(0, 0)");
 
     oss.str("");
     oss << eva;
     std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "person(0, 0)" );
+ BOOST_TEST(oss.str() == "person(0, 0)");
 
     world w;
     w.add_person(adam);
@@ -105,6 +104,7 @@
     oss.str("");
     oss << w;
     std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "world(3, { person(1, 2), person(2, 2), })" );
+ BOOST_TEST(oss.str() == "world(3, { person(1, 2), person(2, 2), })");
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/example/scope_exit.hpp
==============================================================================
--- /trunk/libs/local_function/example/scope_exit.hpp (original)
+++ branches/release/libs/local_function/example/scope_exit.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -25,10 +25,12 @@
 
 // PRIVATE //
 
+//[scope_exit_end_macro
 #define SCOPE_EXIT_END_(id) \
     BOOST_LOCAL_FUNCTION_NAME(BOOST_PP_CAT(scope_exit_func_, id)) \
     scope_exit BOOST_PP_CAT(scope_exit_, id)( \
             BOOST_PP_CAT(scope_exit_func_, id));
+//]
 
 // PUBLIC //
 
@@ -36,8 +38,10 @@
 # define SCOPE_EXIT(void_or_seq) \
         void BOOST_LOCAL_FUNCTION(void_or_seq)
 #else
+//[scope_exit_macro
 # define SCOPE_EXIT(...) \
         void BOOST_LOCAL_FUNCTION(__VA_ARGS__)
+//]
 #endif
 
 #define SCOPE_EXIT_END \

Modified: branches/release/libs/local_function/test/Jamfile.v2
==============================================================================
--- /trunk/libs/local_function/test/Jamfile.v2 (original)
+++ branches/release/libs/local_function/test/Jamfile.v2 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,39 +7,45 @@
 
 import testing ;
 
-project : requirements <library>/boost//unit_test_framework ;
+# Sun does not automatically detect type-of emulation mode (force it).
+project : requirements <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
 
-run add.cpp ;
-run add_classifiers.cpp ;
-run add_default.cpp ;
-run add_except.cpp ;
-run add_inline.cpp ;
-run add_lambda.cpp ;
-run add_params.cpp ;
-run add_template.cpp ;
-run add_this.cpp ;
-run add_typed.cpp ;
-run add_with_default.cpp ;
-
-run factorial.cpp ;
-run goto.cpp ;
-compile-fail goto_err.cpp ;
-run macro_commas.cpp ;
-run nesting.cpp ;
-run operator.cpp ;
-compile-fail operator_err.cpp ;
-run overload.cpp ;
-run ten_void.cpp ;
-run transform.cpp ;
-run typeof.cpp ;
-run typeof_template.cpp ;
-
-run return_assign.cpp ;
-run return_derivative.cpp ;
-run return_inc.cpp ;
-run return_setget.cpp ;
-run return_this.cpp ;
+rule vaseq ( command target )
+{
+ $(command) $(target).cpp ;
+ $(command) $(target)_seq.cpp ;
+ $(command) $(target)_seq_nova.cpp ;
+}
+
+vaseq run add ;
+vaseq run add_classifiers ;
+vaseq run add_default ;
+vaseq run add_except ;
+vaseq run add_inline ;
+vaseq run add_params_only ;
+vaseq run add_template ;
+vaseq run add_this ;
+vaseq run add_typed ;
+vaseq run add_with_default ;
+vaseq run all_decl ;
+vaseq run factorial ;
+vaseq run goto ;
+vaseq compile-fail goto_error ;
+vaseq run macro_commas ;
+vaseq run nesting ;
+vaseq run operator ;
+vaseq compile-fail operator_error ;
+vaseq run overload ;
+vaseq run return_assign ;
+vaseq run return_derivative ;
+vaseq run return_inc ;
+vaseq run return_setget ;
+vaseq run return_this ;
+vaseq run same_line ;
+vaseq run transform ;
+vaseq run typeof ;
+vaseq run typeof_template ;
 
-run add_seq.cpp ;
-run seq.cpp ;
+run ten_void.cpp ;
+run ten_void_nova.cpp ;
 

Modified: branches/release/libs/local_function/test/add.cpp
==============================================================================
--- /trunk/libs/local_function/test/add.cpp (original)
+++ branches/release/libs/local_function/test/add.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,14 +5,17 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAdd
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 
-BOOST_AUTO_TEST_CASE( test_add )
 //[add
-{ // Some local scope.
+int main(void) { // Some local scope.
     int sum = 0, factor = 10; // Variables in scope to bind.
     
     void BOOST_LOCAL_FUNCTION(const bind factor, bind& sum, int num) {
@@ -23,7 +26,10 @@
     int nums[] = {2, 3};
     std::for_each(nums, nums + 2, add); // Pass it to an algorithm.
 
- BOOST_CHECK( sum == 60 ); // Assert final summation value.
+ BOOST_TEST(sum == 60); // Assert final summation value.
+ return boost::report_errors();
 }
 //]
 
+#endif // VARIADIC_MACROS
+

Modified: branches/release/libs/local_function/test/add_classifiers.cpp
==============================================================================
--- /trunk/libs/local_function/test/add_classifiers.cpp (original)
+++ branches/release/libs/local_function/test/add_classifiers.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,25 +6,25 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/config.hpp>
-#ifdef BOOST_NO_AUTO_DECLARATIONS // No C++11 auto declarations.
+#if !defined(BOOST_NO_AUTO_DECLARATIONS)
+# error "auto-declarations not allowed (using `auto` as storage classifier)"
+#elif defined(BOOST_NO_VARIADIC_MACROS)
+# error "variadic macros required"
+#else
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddClassifiers
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE( test_add_classifiers ) {
+int main(void) {
     //[add_classifiers
     int BOOST_LOCAL_FUNCTION(auto int x, register int y) { // Classifiers.
         return x + y;
     } BOOST_LOCAL_FUNCTION_NAME(add)
     //]
 
- BOOST_CHECK( add(1, 2) == 3 );
+ BOOST_TEST(add(1, 2) == 3);
+ return boost::report_errors();
 }
 
-#else // C++11 auto declarations.
-
-int main(void) { return 0; } // Trivial program.
-
-#endif
+#endif // AUTO_DECLARATIONS && VARIADIC_MACROS
 

Copied: branches/release/libs/local_function/test/add_classifiers_seq.cpp (from r77097, /trunk/libs/local_function/test/add_classifiers_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/add_classifiers_seq.cpp (original)
+++ branches/release/libs/local_function/test/add_classifiers_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,23 +6,21 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/config.hpp>
-#ifdef BOOST_NO_AUTO_DECLARATIONS
+#ifndef BOOST_NO_AUTO_DECLARATIONS
+# error "auto-declarations not allowed (using `auto` as storage classifier)"
+#else
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddClassifiersSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE(test_add_classifiers_seq) {
+int main(void) {
     int BOOST_LOCAL_FUNCTION( (auto int x) (register int y) ) {
         return x + y;
     } BOOST_LOCAL_FUNCTION_NAME(add)
 
- BOOST_CHECK(add(1, 2) == 3);
+ BOOST_TEST(add(1, 2) == 3);
+ return boost::report_errors();
 }
 
-#else
-
-int main(void) { return 0; } // Trivial test.
-
-#endif
+#endif // AUTO_DECLARATIONS
 

Modified: branches/release/libs/local_function/test/add_default.cpp
==============================================================================
--- /trunk/libs/local_function/test/add_default.cpp (original)
+++ branches/release/libs/local_function/test/add_default.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,18 +5,24 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddDefault
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE( test_add_default ) {
+int main(void) {
     //[add_default
- int BOOST_LOCAL_FUNCTION(int x, int y, default 2) { // Default.
+ int BOOST_LOCAL_FUNCTION(int x, int y, default 2) { // Default parameter.
         return x + y;
     } BOOST_LOCAL_FUNCTION_NAME(add)
 
- BOOST_CHECK( add(1) == 3 );
+ BOOST_TEST(add(1) == 3);
     //]
+ return boost::report_errors();
 }
-//]
+
+#endif // VARIADIC_MACROS
 

Copied: branches/release/libs/local_function/test/add_default_seq.cpp (from r77097, /trunk/libs/local_function/test/add_default_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/add_default_seq.cpp (original)
+++ branches/release/libs/local_function/test/add_default_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,14 +6,14 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddDefaultSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE(test_add_default_seq) {
+int main(void) {
     int BOOST_LOCAL_FUNCTION( (int x) (int y)(default 2) ) {
         return x + y;
     } BOOST_LOCAL_FUNCTION_NAME(add)
 
- BOOST_CHECK(add(1) == 3);
+ BOOST_TEST(add(1) == 3);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/add_except.cpp
==============================================================================
--- /trunk/libs/local_function/test/add_except.cpp (original)
+++ branches/release/libs/local_function/test/add_except.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,11 +5,15 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddExcept
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE( test_except ) {
+int main(void) {
     //[add_except
     double sum = 0.0;
     int factor = 10;
@@ -21,7 +25,10 @@
 
     add(100);
     //]
-
- BOOST_CHECK( sum == 1000 );
+
+ BOOST_TEST(sum == 1000);
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/add_except_seq.cpp (from r77097, /trunk/libs/local_function/test/add_except_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/add_except_seq.cpp (original)
+++ branches/release/libs/local_function/test/add_except_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,10 +6,9 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddExceptSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE(test_except_seq) {
+int main(void) {
     double sum = 0.0;
     int factor = 10;
 
@@ -20,6 +19,7 @@
 
     add(100);
     
- BOOST_CHECK(sum == 1000);
+ BOOST_TEST(sum == 1000);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/add_inline.cpp
==============================================================================
--- /trunk/libs/local_function/test/add_inline.cpp (original)
+++ branches/release/libs/local_function/test/add_inline.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,20 +5,23 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
-//[ add_function_inline_cpp
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddInline
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 #include <algorithm>
 
-BOOST_AUTO_TEST_CASE( test_add_inline ) {
+int main(void) {
     //[add_inline
     int sum = 0, factor = 10;
 
     void BOOST_LOCAL_FUNCTION(const bind factor, bind& sum, int num) {
         sum += factor * num;
- } BOOST_LOCAL_FUNCTION_NAME(inline add) // Inlined.
+ } BOOST_LOCAL_FUNCTION_NAME(inline add) // Inlining.
 
     std::vector<int> v(100);
     std::fill(v.begin(), v.end(), 1);
@@ -26,6 +29,9 @@
     for(size_t i = 0; i < v.size(); ++i) add(v[i]); // Cannot use for_each.
     //]
 
- BOOST_CHECK( sum == 1000 );
+ BOOST_TEST(sum == 1000);
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/add_inline_seq.cpp (from r77097, /trunk/libs/local_function/test/add_inline_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/add_inline_seq.cpp (original)
+++ branches/release/libs/local_function/test/add_inline_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,12 +6,11 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddInlineSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 #include <algorithm>
 
-BOOST_AUTO_TEST_CASE(test_add_inline_seq) {
+int main(void) {
     int sum = 0, factor = 10;
 
     void BOOST_LOCAL_FUNCTION( (const bind factor) (bind& sum) (int num) ) {
@@ -23,6 +22,7 @@
 
     for(size_t i = 0; i < v.size(); ++i) add(v[i]);
 
- BOOST_CHECK(sum == 1000);
+ BOOST_TEST(sum == 1000);
+ return boost::report_errors();
 }
 

Deleted: /trunk/libs/local_function/test/add_lambda.cpp
==============================================================================
--- /trunk/libs/local_function/test/add_lambda.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,37 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/local_function
-
-#include <boost/config.hpp>
-#ifndef BOOST_NO_LAMBDAS
-
-#define BOOST_TEST_MODULE TestAddLambda
-#include <boost/test/unit_test.hpp>
-#include <algorithm>
-
-BOOST_AUTO_TEST_CASE( test_add_lambda )
-//[add_lambda
-{ // Some local scope.
- int sum = 0, factor = 10; // Variables in scope to bind.
-
- auto add = [factor, &sum](int num) { // C++11 only.
- sum += factor * num;
- };
-
- add(1); // Call the lambda.
- int nums[] = {2, 3};
- std::for_each(nums, nums + 2, add); // Pass it to an algorithm.
-
- BOOST_CHECK( sum == 60 ); // Assert final summation value.
-}
-//]
-
-#else // NO_LAMBDAS
-
-int main(void) { return 0; } // Trivial program.
-
-#endif // NO_LAMBDAS
-

Deleted: /trunk/libs/local_function/test/add_params.cpp
==============================================================================
--- /trunk/libs/local_function/test/add_params.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,22 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/local_function
-
-#include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddParams
-#include <boost/test/unit_test.hpp>
-
-BOOST_AUTO_TEST_CASE( test_add_params ) {
- //[add_params
- int BOOST_LOCAL_FUNCTION(int x, int y) { // Local function.
- return x + y;
- } BOOST_LOCAL_FUNCTION_NAME(add)
-
- BOOST_CHECK( add(1, 2) == 3 ); // Local function call.
- //]
-}
-//]
-

Copied: branches/release/libs/local_function/test/add_params_only.cpp (from r77097, /trunk/libs/local_function/test/add_params_only.cpp)
==============================================================================
--- /trunk/libs/local_function/test/add_params_only.cpp (original)
+++ branches/release/libs/local_function/test/add_params_only.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,25 +6,23 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/config.hpp>
-#ifndef BOOST_NO_VARIADIC_MACROS
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddParamsOnly
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE(test_add_params_only) {
+int main(void) {
     //[add_params_only
     int BOOST_LOCAL_FUNCTION(int x, int y) { // Local function.
         return x + y;
     } BOOST_LOCAL_FUNCTION_NAME(add)
     
- BOOST_CHECK(add(1, 2) == 3); // Local function call.
+ BOOST_TEST(add(1, 2) == 3); // Local function call.
     //]
+ return boost::report_errors();
 }
 
-#else
-
-int main(void) { return 0; } // Trivial test.
-
-#endif
+#endif // VARIADIC_MACROS
 

Copied: branches/release/libs/local_function/test/add_params_only_seq.cpp (from r77097, /trunk/libs/local_function/test/add_params_only_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/add_params_only_seq.cpp (original)
+++ branches/release/libs/local_function/test/add_params_only_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,14 +6,14 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddParamsOnlySeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE(test_add_params_only_seq) {
+int main(void) {
     int BOOST_LOCAL_FUNCTION( (int x) (int y) ) {
         return x + y;
     } BOOST_LOCAL_FUNCTION_NAME(add)
     
- BOOST_CHECK(add(1, 2) == 3);
+ BOOST_TEST(add(1, 2) == 3);
+ return boost::report_errors();
 }
 

Copied: branches/release/libs/local_function/test/add_seq.cpp (from r77097, /trunk/libs/local_function/test/add_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/add_seq.cpp (original)
+++ branches/release/libs/local_function/test/add_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,13 +6,11 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 
-BOOST_AUTO_TEST_CASE(test_add_seq)
 //[add_seq
-{
+int main(void) {
     int sum = 0, factor = 10;
     
     void BOOST_LOCAL_FUNCTION( (const bind factor) (bind& sum) (int num) ) {
@@ -23,7 +21,8 @@
     int nums[] = {2, 3};
     std::for_each(nums, nums + 2, add);
 
- BOOST_CHECK(sum == 60);
+ BOOST_TEST(sum == 60);
+ return boost::report_errors();
 }
 //]
 

Modified: branches/release/libs/local_function/test/add_template.cpp
==============================================================================
--- /trunk/libs/local_function/test/add_template.cpp (original)
+++ branches/release/libs/local_function/test/add_template.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,9 +5,13 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddTemplate
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 
 //[add_template
@@ -15,10 +19,10 @@
 T total(const T& x, const T& y, const T& z) {
     T sum = T(), factor = 10;
 
- // Using the `..._TPL` macro.
+ // Must use the `..._TPL` macros within templates.
     T BOOST_LOCAL_FUNCTION_TPL(const bind factor, bind& sum, T num) {
         return sum += factor * num;
- } BOOST_LOCAL_FUNCTION_NAME(add)
+ } BOOST_LOCAL_FUNCTION_NAME_TPL(add)
 
     add(x);
     T nums[2]; nums[0] = y; nums[1] = z;
@@ -28,7 +32,10 @@
 }
 //]
 
-BOOST_AUTO_TEST_CASE( test_add_template ) {
- BOOST_CHECK( total(1, 2, 3) == 60 );
+int main(void) {
+ BOOST_TEST(total(1, 2, 3) == 60);
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/add_template_seq.cpp (from r77097, /trunk/libs/local_function/test/add_template_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/add_template_seq.cpp (original)
+++ branches/release/libs/local_function/test/add_template_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,8 +6,7 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddTemplateSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 
 template<typename T>
@@ -16,7 +15,7 @@
 
     T BOOST_LOCAL_FUNCTION_TPL( (const bind factor) (bind& sum) (T num) ) {
         return sum += factor * num;
- } BOOST_LOCAL_FUNCTION_NAME(add)
+ } BOOST_LOCAL_FUNCTION_NAME_TPL(add)
 
     add(x);
     T nums[2]; nums[0] = y; nums[1] = z;
@@ -25,7 +24,8 @@
     return sum;
 }
 
-BOOST_AUTO_TEST_CASE(test_add_template_seq) {
- BOOST_CHECK(total(1, 2, 3) == 60);
+int main(void) {
+ BOOST_TEST(total(1, 2, 3) == 60);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/add_this.cpp
==============================================================================
--- /trunk/libs/local_function/test/add_this.cpp (original)
+++ branches/release/libs/local_function/test/add_this.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,15 +5,24 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddThis
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 #include <algorithm>
 
+struct adder;
+BOOST_TYPEOF_REGISTER_TYPE(adder) // Register before `bind this_` below.
+
 //[add_this
 struct adder {
- adder(): sum_(0) {}
+ adder() : sum_(0) {}
 
     int sum(const std::vector<int>& nums, const int factor = 10) {
 
@@ -24,15 +33,19 @@
         std::for_each(nums.begin(), nums.end(), add);
         return sum_;
     }
+
 private:
     int sum_;
 };
 //]
 
-BOOST_AUTO_TEST_CASE( test_add_this ) {
+int main(void) {
     std::vector<int> v(3);
     v[0] = 1; v[1] = 2; v[2] = 3;
 
- BOOST_CHECK( adder().sum(v) == 60 );
+ BOOST_TEST(adder().sum(v) == 60);
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/add_this_seq.cpp (from r77097, /trunk/libs/local_function/test/add_this_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/add_this_seq.cpp (original)
+++ branches/release/libs/local_function/test/add_this_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,11 +6,15 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddThisSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 #include <algorithm>
 
+struct adder;
+BOOST_TYPEOF_REGISTER_TYPE(adder) // Register before `bind this_` below.
+
 struct adder {
     adder() : sum_(0) {}
 
@@ -29,10 +33,11 @@
     int sum_;
 };
 
-BOOST_AUTO_TEST_CASE(test_add_this_seq) {
+int main(void) {
     std::vector<int> v(3);
     v[0] = 1; v[1] = 2; v[2] = 3;
 
- BOOST_CHECK(adder().sum(v) == 60);
+ BOOST_TEST(adder().sum(v) == 60);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/add_typed.cpp
==============================================================================
--- /trunk/libs/local_function/test/add_typed.cpp (original)
+++ branches/release/libs/local_function/test/add_typed.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,18 +5,22 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddTyped
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 #include <algorithm>
 
 //[add_typed
 struct adder {
- adder(): sum_(0) {}
+ adder(void) : sum_(0) {}
 
     int sum(const std::vector<int>& nums, const int& factor = 10) {
- // Explicitly specify bound variable and result types.
+ // Explicitly specify bound variable and return types (no type-of).
         BOOST_LOCAL_FUNCTION(const bind(const int&) factor,
                 bind(adder*) this_, int num, return int) {
             return this_->sum_ += factor * num;
@@ -25,15 +29,19 @@
         std::for_each(nums.begin(), nums.end(), add);
         return sum_;
     }
+
 private:
     int sum_;
 };
 //]
 
-BOOST_AUTO_TEST_CASE( test_add_typed ) {
+int main(void) {
     std::vector<int> v(3);
     v[0] = 1; v[1] = 2; v[2] = 3;
 
- BOOST_CHECK( adder().sum(v) == 60 );
+ BOOST_TEST(adder().sum(v) == 60);
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/add_typed_seq.cpp (from r77097, /trunk/libs/local_function/test/add_typed_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/add_typed_seq.cpp (original)
+++ branches/release/libs/local_function/test/add_typed_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,13 +6,12 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddTypedSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 #include <algorithm>
 
 struct adder {
- adder() : sum_(0) {}
+ adder(void) : sum_(0) {}
 
     int sum(const std::vector<int>& nums, const int& factor = 10) {
         BOOST_LOCAL_FUNCTION( (const bind(const int&) factor)
@@ -28,10 +27,11 @@
     int sum_;
 };
 
-BOOST_AUTO_TEST_CASE(test_add_typed_seq) {
+int main(void) {
     std::vector<int> v(3);
     v[0] = 1; v[1] = 2; v[2] = 3;
 
- BOOST_CHECK(adder().sum(v) == 60);
+ BOOST_TEST(adder().sum(v) == 60);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/add_with_default.cpp
==============================================================================
--- /trunk/libs/local_function/test/add_with_default.cpp (original)
+++ branches/release/libs/local_function/test/add_with_default.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,22 +5,28 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddWithDefault
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
 //[add_with_default_macro
 #define WITH_DEFAULT , default
 //]
 
-BOOST_AUTO_TEST_CASE( test_add_with_default ) {
+int main(void) {
     //[add_with_default
     int BOOST_LOCAL_FUNCTION(int x, int y WITH_DEFAULT 2) { // Default.
         return x + y;
     } BOOST_LOCAL_FUNCTION_NAME(add)
 
- BOOST_CHECK( add(1) == 3 );
+ BOOST_TEST(add(1) == 3);
     //]
+ return boost::report_errors();
 }
-//]
+
+#endif // VARIADIC_MACROS
 

Copied: branches/release/libs/local_function/test/add_with_default_seq.cpp (from r77097, /trunk/libs/local_function/test/add_with_default_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/add_with_default_seq.cpp (original)
+++ branches/release/libs/local_function/test/add_with_default_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,16 +6,16 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestAddWithDefaultSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
 #define WITH_DEFAULT )(default
 
-BOOST_AUTO_TEST_CASE(test_add_with_default_seq) {
+int main(void) {
     int BOOST_LOCAL_FUNCTION( (int x) (int y WITH_DEFAULT 2) ) {
         return x + y;
     } BOOST_LOCAL_FUNCTION_NAME(add)
 
- BOOST_CHECK(add(1) == 3);
+ BOOST_TEST(add(1) == 3);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/addable.hpp
==============================================================================
--- /trunk/libs/local_function/test/addable.hpp (original)
+++ branches/release/libs/local_function/test/addable.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -15,10 +15,13 @@
     BOOST_CONCEPT_USAGE(Addable) {
         return_type(x + y); // Check addition `T operator+(T x, T y)`.
     }
+
 private:
- T x;
- T y;
- void return_type(T const&); // Used to check addition returns type `T`.
+ T const& x;
+ T const& y;
+
+ void return_type(T const&) // Used to check addition returns type `T`.
+ {} // Do nothing implementation (required for some linkers).
 };
 
 #endif // #include guard

Copied: branches/release/libs/local_function/test/all_decl.cpp (from r77097, /trunk/libs/local_function/test/all_decl.cpp)
==============================================================================
--- /trunk/libs/local_function/test/all_decl.cpp (original)
+++ branches/release/libs/local_function/test/all_decl.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,9 +6,16 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/config.hpp>
-#ifndef BOOST_NO_VARIADIC_MACROS
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
 
 #include <boost/local_function.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+struct s;
+BOOST_TYPEOF_REGISTER_TYPE(s) // Register before binding `this_` below.
 
 // Compile all local function declaration combinations.
 struct s {
@@ -166,9 +173,5 @@
     return 0;
 }
 
-#else
-
-int main(void) { return 0; }
-
-#endif
+#endif // VARIADIC_MACROS
 

Copied: branches/release/libs/local_function/test/all_decl_seq.cpp (from r77097, /trunk/libs/local_function/test/all_decl_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/all_decl_seq.cpp (original)
+++ branches/release/libs/local_function/test/all_decl_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,6 +6,11 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+struct s;
+BOOST_TYPEOF_REGISTER_TYPE(s); // Register before bind `this_` below.
 
 // Compile all local function declaration combinations.
 struct s {

Modified: branches/release/libs/local_function/test/factorial.cpp
==============================================================================
--- /trunk/libs/local_function/test/factorial.cpp (original)
+++ branches/release/libs/local_function/test/factorial.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,12 +5,21 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestFactorial
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 #include <vector>
 
+struct calculator;
+BOOST_TYPEOF_REGISTER_TYPE(calculator) // Register before `bind this_` below.
+
 //[factorial
 struct calculator {
     std::vector<int> results;
@@ -32,14 +41,17 @@
 };
 //]
 
-BOOST_AUTO_TEST_CASE( test_factorial ) {
+int main(void) {
     std::vector<int> v(3);
     v[0] = 1; v[1] = 3; v[2] = 4;
 
     calculator calc;
     calc.factorials(v);
- BOOST_CHECK( calc.results[0] == 1 );
- BOOST_CHECK( calc.results[1] == 6 );
- BOOST_CHECK( calc.results[2] == 24 );
+ BOOST_TEST(calc.results[0] == 1);
+ BOOST_TEST(calc.results[1] == 6);
+ BOOST_TEST(calc.results[2] == 24);
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/factorial_seq.cpp (from r77097, /trunk/libs/local_function/test/factorial_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/factorial_seq.cpp (original)
+++ branches/release/libs/local_function/test/factorial_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,11 +6,15 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestFactorialSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 #include <vector>
 
+struct calculator;
+BOOST_TYPEOF_REGISTER_TYPE(calculator) // Register before `bind this_` below.
+
 struct calculator {
     std::vector<int> results;
 
@@ -30,14 +34,15 @@
     }
 };
 
-BOOST_AUTO_TEST_CASE(test_factorial_seq) {
+int main(void) {
     std::vector<int> v(3);
     v[0] = 1; v[1] = 3; v[2] = 4;
 
     calculator calc;
     calc.factorials(v);
- BOOST_CHECK(calc.results[0] == 1);
- BOOST_CHECK(calc.results[1] == 6);
- BOOST_CHECK(calc.results[2] == 24);
+ BOOST_TEST(calc.results[0] == 1);
+ BOOST_TEST(calc.results[1] == 6);
+ BOOST_TEST(calc.results[2] == 24);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/goto.cpp
==============================================================================
--- /trunk/libs/local_function/test/goto.cpp (original)
+++ branches/release/libs/local_function/test/goto.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,14 +5,17 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestGoto
-#include <boost/test/unit_test.hpp>
 
 //[goto
 int error(int x, int y) {
- int BOOST_LOCAL_FUNCTION(int x) {
- if(x > 0) goto success; // OK: Can jump within local function.
+ int BOOST_LOCAL_FUNCTION(int z) {
+ if(z > 0) goto success; // OK: Can jump within local function.
         return -1;
     success:
         return 0;
@@ -22,7 +25,10 @@
 }
 //]
 
-BOOST_AUTO_TEST_CASE( test_goto ) {
+int main(void) {
     error(1, 2);
+ return 0;
 }
 
+#endif // VARIADIC_MACROS
+

Deleted: /trunk/libs/local_function/test/goto_err.cpp
==============================================================================
--- /trunk/libs/local_function/test/goto_err.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,31 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/local_function
-
-#include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestGotoErr
-#include <boost/test/unit_test.hpp>
-
-//[goto_err
-int error(int x, int y) {
- int BOOST_LOCAL_FUNCTION(int x) {
- if(x <= 0) goto failure; // Error: Cannot jump to enclosing scope.
- else goto success; // OK: Can jump within local function.
-
- success:
- return 0;
- } BOOST_LOCAL_FUNCTION_NAME(validate)
-
- return validate(x + y);
-faliure:
- return -1;
-}
-//]
-
-BOOST_AUTO_TEST_CASE( test_goto_err ) {
- error(1, 2);
-}
-

Copied: branches/release/libs/local_function/test/goto_error.cpp (from r77042, /trunk/libs/local_function/test/goto_error.cpp)
==============================================================================
--- /trunk/libs/local_function/test/goto_error.cpp (original)
+++ branches/release/libs/local_function/test/goto_error.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,27 +5,32 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestGotoErr
-#include <boost/test/unit_test.hpp>
 
 //[goto_error
 int error(int x, int y) {
- int BOOST_LOCAL_FUNCTION(int x) {
- if(x <= 0) goto failure; // Error: Cannot jump to enclosing scope.
+ int BOOST_LOCAL_FUNCTION(int z) {
+ if(z <= 0) goto failure; // Error: Cannot jump to enclosing scope.
         else goto success; // OK: Can jump within local function.
-
     success:
         return 0;
     } BOOST_LOCAL_FUNCTION_NAME(validate)
 
     return validate(x + y);
-faliure:
+failure:
     return -1;
 }
 //]
 
-BOOST_AUTO_TEST_CASE( test_goto_err ) {
+int main(void) {
     error(1, 2);
+ return 0;
 }
 
+#endif
+

Copied: branches/release/libs/local_function/test/goto_error_seq.cpp (from r77097, /trunk/libs/local_function/test/goto_error_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/goto_error_seq.cpp (original)
+++ branches/release/libs/local_function/test/goto_error_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,23 +6,22 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestGotoErrorSeq
-#include <boost/test/unit_test.hpp>
 
 int error(int x, int y) {
- int BOOST_LOCAL_FUNCTION( (int x) ) {
- if(x <= 0) goto failure;
+ int BOOST_LOCAL_FUNCTION( (int z) ) {
+ if(z <= 0) goto failure;
         else goto success;
     success:
         return 0;
     } BOOST_LOCAL_FUNCTION_NAME(validate)
 
     return validate(x + y);
-faliure:
+failure:
     return -1;
 }
 
-BOOST_AUTO_TEST_CASE(test_goto_error_seq) {
+int main(void) {
     error(1, 2);
+ return 0;
 }
 

Copied: branches/release/libs/local_function/test/goto_seq.cpp (from r77097, /trunk/libs/local_function/test/goto_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/goto_seq.cpp (original)
+++ branches/release/libs/local_function/test/goto_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,12 +6,10 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestGotoSeq
-#include <boost/test/unit_test.hpp>
 
 int error(int x, int y) {
- int BOOST_LOCAL_FUNCTION( (int x) ) {
- if(x > 0) goto success;
+ int BOOST_LOCAL_FUNCTION( (int z) ) {
+ if(z > 0) goto success;
         return -1;
     success:
         return 0;
@@ -20,7 +18,8 @@
     return validate(x + y);
 }
 
-BOOST_AUTO_TEST_CASE(test_goto_seq) {
+int main(void) {
     error(1, 2);
+ return 0;
 }
 

Modified: branches/release/libs/local_function/test/macro_commas.cpp
==============================================================================
--- /trunk/libs/local_function/test/macro_commas.cpp (original)
+++ branches/release/libs/local_function/test/macro_commas.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,11 +5,15 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
 #include <boost/utility/identity_type.hpp>
-#include <boost/config.hpp>
-#define BOOST_TEST_MODULE TestMacroCommas
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/std/string.hpp> // Type-of registrations
+#include <boost/typeof/std/map.hpp> // needed for `NAME` macro.
 #include <map>
 #include <string>
 
@@ -17,12 +21,15 @@
 
 template<typename V, typename K>
 struct key_sizeof {
- BOOST_STATIC_CONSTANT(int, value = sizeof(K));
+ static int const value;
 };
 
+template<typename V, typename K>
+int const key_sizeof<V, K>::value = sizeof(K);
+
 typedef int sign_t;
 
-BOOST_AUTO_TEST_CASE( test_macro_commas ) {
+int main(void) {
     //[macro_commas
     void BOOST_LOCAL_FUNCTION(
         BOOST_IDENTITY_TYPE((const std::map<std::string, size_t>&)) m,
@@ -38,5 +45,8 @@
     std::map<std::string, size_t> m;
     ::sign_t sign = -1;
     f(m, sign);
+ return 0;
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/macro_commas_seq.cpp (from r77097, /trunk/libs/local_function/test/macro_commas_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/macro_commas_seq.cpp (original)
+++ branches/release/libs/local_function/test/macro_commas_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,9 +7,9 @@
 
 #include <boost/local_function.hpp>
 #include <boost/utility/identity_type.hpp>
+#include <boost/typeof/std/string.hpp> // Type-of registrations
+#include <boost/typeof/std/map.hpp> // needed for `NAME` macro.
 #include <boost/config.hpp>
-#define BOOST_TEST_MODULE TestMacroCommasSeq
-#include <boost/test/unit_test.hpp>
 #include <map>
 #include <string>
 
@@ -17,12 +17,15 @@
 
 template<typename V, typename K>
 struct key_sizeof {
- BOOST_STATIC_CONSTANT(int, value = sizeof(K));
+ static int const value;
 };
 
+template<typename V, typename K>
+int const key_sizeof<V, K>::value = sizeof(K);
+
 typedef int sign_t;
 
-BOOST_AUTO_TEST_CASE(test_macro_commas_seq) {
+int main(void) {
     void BOOST_LOCAL_FUNCTION(
         (BOOST_IDENTITY_TYPE((const std::map<std::string, size_t>&)) m)
         (BOOST_IDENTITY_TYPE((::sign_t)) sign)
@@ -36,5 +39,6 @@
     std::map<std::string, size_t> m;
     ::sign_t sign = -1;
     f(m, sign);
+ return 0;
 }
 

Modified: branches/release/libs/local_function/test/nesting.cpp
==============================================================================
--- /trunk/libs/local_function/test/nesting.cpp (original)
+++ branches/release/libs/local_function/test/nesting.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,11 +5,15 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestNesting
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE( test_nesting ) {
+int main(void) {
     //[nesting
     int x = 0;
 
@@ -24,6 +28,10 @@
     
     f();
     //]
- BOOST_CHECK( x == 0 );
+
+ BOOST_TEST(x == 0);
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/nesting_seq.cpp (from r77097, /trunk/libs/local_function/test/nesting_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/nesting_seq.cpp (original)
+++ branches/release/libs/local_function/test/nesting_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,10 +6,9 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestNestingSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE(test_nesting_seq) {
+int main(void) {
     int x = 0;
 
     void BOOST_LOCAL_FUNCTION( (bind& x) ) {
@@ -23,6 +22,7 @@
     
     f();
 
- BOOST_CHECK(x == 0);
+ BOOST_TEST(x == 0);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/operator.cpp
==============================================================================
--- /trunk/libs/local_function/test/operator.cpp (original)
+++ branches/release/libs/local_function/test/operator.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,24 +5,34 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestOperator
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+#include <boost/detail/lightweight_test.hpp>
 
 //[operator
 struct point {
     int x;
     int y;
 };
+BOOST_TYPEOF_REGISTER_TYPE(point) // Register for `NAME` below.
 
-BOOST_AUTO_TEST_CASE( test_operator ) {
+int main(void) {
     bool BOOST_LOCAL_FUNCTION(const point& p, const point& q) {
         return p.x == q.x && p.y == q.y;
- } BOOST_LOCAL_FUNCTION_NAME(equal) // OK: not using `operator...`.
+ } BOOST_LOCAL_FUNCTION_NAME(equal) // OK: not using `operator==`.
 
     point a; a.x = 1; a.y = 2;
     point b = a;
- BOOST_CHECK( equal(a, b) );
+ BOOST_TEST(equal(a, b));
+ return boost::report_errors();
 }
 //]
 
+#endif // VARIADIC_MACROS
+

Deleted: /trunk/libs/local_function/test/operator_err.cpp
==============================================================================
--- /trunk/libs/local_function/test/operator_err.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,28 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/local_function
-
-#include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestOperatorErr
-#include <boost/test/unit_test.hpp>
-
-//[operator_err
-struct point {
- int x;
- int y;
-};
-
-BOOST_AUTO_TEST_CASE( test_operator_err ) {
- bool BOOST_LOCAL_FUNCTION(const point& p, const point& q) {
- return p.x == q.x && p.y == q.y;
- } BOOST_LOCAL_FUNCTION_NAME(operator==) // Error: Cannot use `operator...`.
-
- point a; a.x = 1; a.y = 2;
- point b = a;
- BOOST_CHECK( a == b );
-}
-//]
-

Copied: branches/release/libs/local_function/test/operator_error.cpp (from r77042, /trunk/libs/local_function/test/operator_error.cpp)
==============================================================================
--- /trunk/libs/local_function/test/operator_error.cpp (original)
+++ branches/release/libs/local_function/test/operator_error.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,24 +5,34 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestOperatorErr
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+#include <boost/detail/lightweight_test.hpp>
 
-//[operator_error
 struct point {
     int x;
     int y;
 };
+BOOST_TYPEOF_REGISTER_TYPE(point) // Register for `NAME` below.
 
-BOOST_AUTO_TEST_CASE( test_operator_err ) {
+int main(void) {
+ //[operator_error
     bool BOOST_LOCAL_FUNCTION(const point& p, const point& q) {
         return p.x == q.x && p.y == q.y;
     } BOOST_LOCAL_FUNCTION_NAME(operator==) // Error: Cannot use `operator...`.
+ //]
 
     point a; a.x = 1; a.y = 2;
     point b = a;
- BOOST_CHECK( a == b );
+ BOOST_TEST(a == b);
+ return boost::report_errors();
 }
-//]
+
+#endif // VARIADIC_MACROS
 

Copied: branches/release/libs/local_function/test/operator_error_seq.cpp (from r77097, /trunk/libs/local_function/test/operator_error_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/operator_error_seq.cpp (original)
+++ branches/release/libs/local_function/test/operator_error_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,21 +6,24 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestOperatorErrorSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+#include <boost/detail/lightweight_test.hpp>
 
 struct point {
     int x;
     int y;
 };
+BOOST_TYPEOF_REGISTER_TYPE(point) // Register for `NAME` below.
 
-BOOST_AUTO_TEST_CASE(test_operator_error_seq) {
+int main(void) {
     bool BOOST_LOCAL_FUNCTION( (const point& p) (const point& q) ) {
         return p.x == q.x && p.y == q.y;
     } BOOST_LOCAL_FUNCTION_NAME(operator==)
 
     point a; a.x = 1; a.y = 2;
     point b = a;
- BOOST_CHECK(a == b);
+ BOOST_TEST(a == b);
+ return boost::report_errors();
 }
 

Copied: branches/release/libs/local_function/test/operator_seq.cpp (from r77097, /trunk/libs/local_function/test/operator_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/operator_seq.cpp (original)
+++ branches/release/libs/local_function/test/operator_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,21 +6,24 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestOperatorSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+#include <boost/detail/lightweight_test.hpp>
 
 struct point {
     int x;
     int y;
 };
+BOOST_TYPEOF_REGISTER_TYPE(point) // Register for `NAME` below.
 
-BOOST_AUTO_TEST_CASE(test_operator_seq) {
+int main(void) {
     bool BOOST_LOCAL_FUNCTION( (const point& p) (const point& q) ) {
         return p.x == q.x && p.y == q.y;
     } BOOST_LOCAL_FUNCTION_NAME(equal)
 
     point a; a.x = 1; a.y = 2;
     point b = a;
- BOOST_CHECK(equal(a, b));
+ BOOST_TEST(equal(a, b));
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/overload.cpp
==============================================================================
--- /trunk/libs/local_function/test/overload.cpp (original)
+++ branches/release/libs/local_function/test/overload.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,17 +5,23 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
 #include <boost/functional/overloaded_function.hpp> // For overloading.
-#define BOOST_TEST_MODULE TestOverload
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/std/string.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <string>
-#include <cmath>
 
-//[overload
+//[overload_decl
 int add_i(int x, int y) { return x + y; }
+//]
 
-BOOST_AUTO_TEST_CASE( test_overload ) {
+int main(void) {
+ //[overload
     std::string s = "abc";
     std::string BOOST_LOCAL_FUNCTION(
             const bind& s, const std::string& x) {
@@ -34,10 +40,13 @@
         , int (int, int)
> add(add_s, add_d, add_d, add_i); // Overloaded function object.
 
- BOOST_CHECK( add("xyz") == "abcxyz" ); // Call `add_s`.
- BOOST_CHECK( fabs(add(3.21) - 4.44) < 0.001 ); // Call `add_d` (no default).
- BOOST_CHECK( fabs(add(3.21, 40.0) - 44.44) < 0.001); // Call `add_d`.
- BOOST_CHECK( add(1, 2) == 3 ); // Call `add_i`.
+ BOOST_TEST(add("xyz") == "abcxyz"); // Call `add_s`.
+ BOOST_TEST((4.44 - add(3.21)) <= 0.001); // Call `add_d` (no default).
+ BOOST_TEST((44.44 - add(3.21, 40.0)) <= 0.001); // Call `add_d`.
+ BOOST_TEST(add(1, 2) == 3); // Call `add_i`.
+ //]
+ return boost::report_errors();
 }
-//]
+
+#endif // VARIADIC_MACROS
 

Copied: branches/release/libs/local_function/test/overload_seq.cpp (from r77097, /trunk/libs/local_function/test/overload_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/overload_seq.cpp (original)
+++ branches/release/libs/local_function/test/overload_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,14 +7,13 @@
 
 #include <boost/local_function.hpp>
 #include <boost/functional/overloaded_function.hpp>
-#define BOOST_TEST_MODULE TestOverloadSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/std/string.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <string>
-#include <cmath>
 
 int add_i(int x, int y) { return x + y; }
 
-BOOST_AUTO_TEST_CASE(test_overload_seq) {
+int main(void) {
     std::string s = "abc";
     std::string BOOST_LOCAL_FUNCTION(
             (const bind& s) (const std::string& x) ) {
@@ -34,9 +33,10 @@
         , int (int, int)
> add(add_s, add_d, add_d, add_i);
 
- BOOST_CHECK(add("xyz") == "abcxyz");
- BOOST_CHECK(fabs(add(3.21) - 4.44) < 0.001);
- BOOST_CHECK(fabs(add(3.21, 40.0) - 44.44) < 0.001);
- BOOST_CHECK(add(1, 2) == 3);
+ BOOST_TEST(add("xyz") == "abcxyz");
+ BOOST_TEST((4.44 - add(3.21)) <= 0.001); // Equal within precision.
+ BOOST_TEST((44.44 - add(3.21, 40.0)) <= 0.001); // Equal within precision.
+ BOOST_TEST(add(1, 2) == 3);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/return_assign.cpp
==============================================================================
--- /trunk/libs/local_function/test/return_assign.cpp (original)
+++ branches/release/libs/local_function/test/return_assign.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,15 +5,19 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
 #include <boost/function.hpp>
-#define BOOST_TEST_MODULE TestReturnAssign
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <iostream>
 
 //[return_assign
-void call1(boost::function<int (int) > f) { BOOST_CHECK( f(1) == 5 ); }
-void call0(boost::function<int (void)> f) { BOOST_CHECK( f() == 5 ); }
+void call1(boost::function<int (int) > f) { BOOST_TEST(f(1) == 5); }
+void call0(boost::function<int (void)> f) { BOOST_TEST(f() == 5); }
 
 boost::function<int (int, int)> linear(const int& slope) {
     int BOOST_LOCAL_FUNCTION(const bind& slope,
@@ -22,7 +26,7 @@
     } BOOST_LOCAL_FUNCTION_NAME(lin)
 
     boost::function<int (int, int)> f = lin; // Assign to local variable.
- BOOST_CHECK( f(1, 2) == 5 );
+ BOOST_TEST(f(1, 2) == 5);
 
     call1(lin); // Pass to other functions.
     call0(lin);
@@ -32,11 +36,14 @@
 
 void call(void) {
     boost::function<int (int, int)> f = linear(2);
- BOOST_CHECK( f(1, 2) == 5 );
+ BOOST_TEST(f(1, 2) == 5);
 }
 //]
 
-BOOST_AUTO_TEST_CASE( test_return_assign ) {
+int main(void) {
     call();
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/return_assign_seq.cpp (from r77097, /trunk/libs/local_function/test/return_assign_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/return_assign_seq.cpp (original)
+++ branches/release/libs/local_function/test/return_assign_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,12 +7,11 @@
 
 #include <boost/local_function.hpp>
 #include <boost/function.hpp>
-#define BOOST_TEST_MODULE TestReturnAssignSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <iostream>
 
-void call1(boost::function<int (int) > f) { BOOST_CHECK(f(1) == 5); }
-void call0(boost::function<int (void)> f) { BOOST_CHECK(f() == 5); }
+void call1(boost::function<int (int) > f) { BOOST_TEST(f(1) == 5); }
+void call0(boost::function<int (void)> f) { BOOST_TEST(f() == 5); }
 
 boost::function<int (int, int)> linear(const int& slope) {
     int BOOST_LOCAL_FUNCTION( (const bind& slope)
@@ -21,7 +20,7 @@
     } BOOST_LOCAL_FUNCTION_NAME(lin)
 
     boost::function<int (int, int)> f = lin;
- BOOST_CHECK(f(1, 2) == 5);
+ BOOST_TEST(f(1, 2) == 5);
 
     call1(lin);
     call0(lin);
@@ -31,10 +30,11 @@
 
 void call(void) {
     boost::function<int (int, int)> f = linear(2);
- BOOST_CHECK(f(1, 2) == 5);
+ BOOST_TEST(f(1, 2) == 5);
 }
 
-BOOST_AUTO_TEST_CASE(test_return_assign_seq) {
+int main(void) {
     call();
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/return_derivative.cpp
==============================================================================
--- /trunk/libs/local_function/test/return_derivative.cpp (original)
+++ branches/release/libs/local_function/test/return_derivative.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,25 +5,37 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
 #include <boost/function.hpp>
-#define BOOST_TEST_MODULE TestReturnDerivative
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+#include <boost/detail/lightweight_test.hpp>
+
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function, 1)
 
 boost::function<int (int)> derivative(boost::function<int (int)>& f, int dx) {
     int BOOST_LOCAL_FUNCTION(bind& f, const bind dx, int x) {
         return (f(x + dx) - f(x)) / dx;
     } BOOST_LOCAL_FUNCTION_NAME(deriv)
+
     return deriv;
 }
 
-BOOST_AUTO_TEST_CASE( test_return_derivative ) {
+int main(void) {
     int BOOST_LOCAL_FUNCTION(int x) {
         return x + 4;
     } BOOST_LOCAL_FUNCTION_NAME(add2)
+
     boost::function<int (int)> a2 = add2; // Reference valid where closure used.
-
     boost::function<int (int)> d2 = derivative(a2, 2);
- BOOST_CHECK( d2(6) == 1 );
+ BOOST_TEST(d2(6) == 1);
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/return_derivative_seq.cpp (from r77097, /trunk/libs/local_function/test/return_derivative_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/return_derivative_seq.cpp (original)
+++ branches/release/libs/local_function/test/return_derivative_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,8 +7,11 @@
 
 #include <boost/local_function.hpp>
 #include <boost/function.hpp>
-#define BOOST_TEST_MODULE TestReturnDerivativeSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+#include <boost/detail/lightweight_test.hpp>
+
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function, 1)
 
 boost::function<int (int)> derivative(boost::function<int (int)>& f, int dx) {
     int BOOST_LOCAL_FUNCTION( (bind& f) (const bind dx) (int x) ) {
@@ -18,14 +21,14 @@
     return deriv;
 }
 
-BOOST_AUTO_TEST_CASE(test_return_derivative_seq) {
+int main(void) {
     int BOOST_LOCAL_FUNCTION( (int x) ) {
         return x + 4;
     } BOOST_LOCAL_FUNCTION_NAME(add2)
     
     boost::function<int (int)> a2 = add2;
-
     boost::function<int (int)> d2 = derivative(a2, 2);
- BOOST_CHECK(d2(6) == 1);
+ BOOST_TEST(d2(6) == 1);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/return_inc.cpp
==============================================================================
--- /trunk/libs/local_function/test/return_inc.cpp (original)
+++ branches/release/libs/local_function/test/return_inc.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,10 +5,14 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
 #include <boost/function.hpp>
-#define BOOST_TEST_MODULE TestReturnInc
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
 boost::function<int (void)> inc(int& value) {
     int BOOST_LOCAL_FUNCTION(bind& value) {
@@ -17,15 +21,18 @@
     return i;
 }
 
-BOOST_AUTO_TEST_CASE( test_return_inc ) {
+int main(void) {
     int value1 = 0; // Reference valid in scope where closure is used.
     boost::function<int (void)> inc1 = inc(value1);
     int value2 = 0;
     boost::function<int (void)> inc2 = inc(value2);
 
- BOOST_CHECK( inc1() == 1 );
- BOOST_CHECK( inc1() == 2 );
- BOOST_CHECK( inc2() == 1 );
- BOOST_CHECK( inc1() == 3 );
+ BOOST_TEST(inc1() == 1);
+ BOOST_TEST(inc1() == 2);
+ BOOST_TEST(inc2() == 1);
+ BOOST_TEST(inc1() == 3);
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/return_inc_seq.cpp (from r77097, /trunk/libs/local_function/test/return_inc_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/return_inc_seq.cpp (original)
+++ branches/release/libs/local_function/test/return_inc_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,8 +7,7 @@
 
 #include <boost/local_function.hpp>
 #include <boost/function.hpp>
-#define BOOST_TEST_MODULE TestReturnIncSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
 boost::function<int (void)> inc(int& value) {
     int BOOST_LOCAL_FUNCTION( (bind& value) ) {
@@ -17,15 +16,16 @@
     return i;
 }
 
-BOOST_AUTO_TEST_CASE(test_return_inc_seq) {
+int main(void) {
     int value1 = 0;
     boost::function<int (void)> inc1 = inc(value1);
     int value2 = 0;
     boost::function<int (void)> inc2 = inc(value2);
 
- BOOST_CHECK(inc1() == 1);
- BOOST_CHECK(inc1() == 2);
- BOOST_CHECK(inc2() == 1);
- BOOST_CHECK(inc1() == 3);
+ BOOST_TEST(inc1() == 1);
+ BOOST_TEST(inc1() == 2);
+ BOOST_TEST(inc2() == 1);
+ BOOST_TEST(inc1() == 3);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/return_setget.cpp
==============================================================================
--- /trunk/libs/local_function/test/return_setget.cpp (original)
+++ branches/release/libs/local_function/test/return_setget.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,10 +5,15 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
 #include <boost/function.hpp>
-#define BOOST_TEST_MODULE TestReturnSetGet
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/std/string.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <string>
 
 boost::function<void (const std::string&)> set;
@@ -16,12 +21,12 @@
 
 void action(void) {
     // State `message` hidden behind access functions from here.
- BOOST_CHECK( get() == "abc" );
+ BOOST_TEST(get() == "abc");
     set("xyz");
- BOOST_CHECK( get() == "xyz" );
+ BOOST_TEST(get() == "xyz");
 }
 
-BOOST_AUTO_TEST_CASE( test_return_setget ) {
+int main(void) {
     std::string message = "abc"; // Reference valid where closure used.
     
     void BOOST_LOCAL_FUNCTION(bind& message, const std::string& text) {
@@ -35,5 +40,8 @@
     get = g;
     
     action();
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/return_setget_seq.cpp (from r77097, /trunk/libs/local_function/test/return_setget_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/return_setget_seq.cpp (original)
+++ branches/release/libs/local_function/test/return_setget_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,20 +7,20 @@
 
 #include <boost/local_function.hpp>
 #include <boost/function.hpp>
-#define BOOST_TEST_MODULE TestReturnSetgetSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/std/string.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <string>
 
 boost::function<void (const std::string&)> set;
 boost::function<const std::string& (void)> get;
 
 void action(void) {
- BOOST_CHECK(get() == "abc");
+ BOOST_TEST(get() == "abc");
     set("xyz");
- BOOST_CHECK(get() == "xyz");
+ BOOST_TEST(get() == "xyz");
 }
 
-BOOST_AUTO_TEST_CASE(test_return_setget_seq) {
+int main(void) {
     std::string message = "abc";
     
     void BOOST_LOCAL_FUNCTION( (bind& message) (const std::string& text) ) {
@@ -34,5 +34,6 @@
     get = g;
     
     action();
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/return_this.cpp
==============================================================================
--- /trunk/libs/local_function/test/return_this.cpp (original)
+++ branches/release/libs/local_function/test/return_this.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,10 +5,19 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
 #include <boost/function.hpp>
-#define BOOST_TEST_MODULE TestReturnThis
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+#include <boost/detail/lightweight_test.hpp>
+
+struct number;
+BOOST_TYPEOF_REGISTER_TYPE(number) // Register before `bind this_` below.
 
 struct number {
     number(int value) : value_(value) {}
@@ -24,15 +33,18 @@
     int value_;
 };
 
-BOOST_AUTO_TEST_CASE( test_return_this ) {
+int main(void) {
     number n1 = 0; // Object valid in scope where closure is used.
     boost::function<int (void)> inc1 = n1.inc();
     number n2 = 0;
     boost::function<int (void)> inc2 = n2.inc();
 
- BOOST_CHECK( inc1() == 1 );
- BOOST_CHECK( inc1() == 2 );
- BOOST_CHECK( inc2() == 1 );
- BOOST_CHECK( inc1() == 3 );
+ BOOST_TEST(inc1() == 1);
+ BOOST_TEST(inc1() == 2);
+ BOOST_TEST(inc2() == 1);
+ BOOST_TEST(inc1() == 3);
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/return_this_seq.cpp (from r77097, /trunk/libs/local_function/test/return_this_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/return_this_seq.cpp (original)
+++ branches/release/libs/local_function/test/return_this_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,8 +7,12 @@
 
 #include <boost/local_function.hpp>
 #include <boost/function.hpp>
-#define BOOST_TEST_MODULE TestReturnThisSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+#include <boost/detail/lightweight_test.hpp>
+
+struct number;
+BOOST_TYPEOF_REGISTER_TYPE(number) // Register before `bind this_` below.
 
 struct number {
     number(int value) : value_(value) {}
@@ -24,15 +28,16 @@
     int value_;
 };
 
-BOOST_AUTO_TEST_CASE(test_return_this_seq) {
+int main(void) {
     number n1 = 0; // Object valid in scope where closure is used.
     boost::function<int (void)> inc1 = n1.inc();
     number n2 = 0;
     boost::function<int (void)> inc2 = n2.inc();
 
- BOOST_CHECK(inc1() == 1);
- BOOST_CHECK(inc1() == 2);
- BOOST_CHECK(inc2() == 1);
- BOOST_CHECK(inc1() == 3);
+ BOOST_TEST(inc1() == 1);
+ BOOST_TEST(inc1() == 2);
+ BOOST_TEST(inc2() == 1);
+ BOOST_TEST(inc1() == 3);
+ return boost::report_errors();
 }
 

Copied: branches/release/libs/local_function/test/same_line.cpp (from r77411, /trunk/libs/local_function/test/same_line.cpp)
==============================================================================
--- /trunk/libs/local_function/test/same_line.cpp (original)
+++ branches/release/libs/local_function/test/same_line.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,40 +6,52 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/config.hpp>
-#ifndef BOOST_NO_VARIADIC_MACROS
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
 
 #include <boost/local_function.hpp>
 #include <boost/preprocessor/cat.hpp>
-#define BOOST_TEST_MODULE TestSameLine
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <iostream>
     
 //[same_line
 #define LOCAL_INC_DEC(offset) \
- int BOOST_LOCAL_FUNCTION_ID( \
- BOOST_PP_CAT(inc, __LINE__) /* unique ID */, 0 /* no TPL */, \
+ int BOOST_LOCAL_FUNCTION_ID(BOOST_PP_CAT(inc, __LINE__), /* unique ID */ \
             const bind offset, const int x) { \
         return x + offset; \
     } BOOST_LOCAL_FUNCTION_NAME(inc) \
     \
- int BOOST_LOCAL_FUNCTION_ID( \
- BOOST_PP_CAT(dec, __LINE__) /* unique ID */, 0 /* no TPL */, \
+ int BOOST_LOCAL_FUNCTION_ID(BOOST_PP_CAT(dec, __LINE__), \
             const bind offset, const int x) { \
         return x - offset; \
     } BOOST_LOCAL_FUNCTION_NAME(dec)
 
-BOOST_AUTO_TEST_CASE(test_same_line)
-{
+#define LOCAL_INC_DEC_TPL(offset) \
+ T BOOST_LOCAL_FUNCTION_ID_TPL(BOOST_PP_CAT(inc, __LINE__), \
+ const bind offset, const T x) { \
+ return x + offset; \
+ } BOOST_LOCAL_FUNCTION_NAME_TPL(inc) \
+ \
+ T BOOST_LOCAL_FUNCTION_ID_TPL(BOOST_PP_CAT(dec, __LINE__), \
+ const bind offset, const T x) { \
+ return x - offset; \
+ } BOOST_LOCAL_FUNCTION_NAME_TPL(dec)
+
+template<typename T>
+void f(T& delta) {
+ LOCAL_INC_DEC_TPL(delta) // Multiple local functions on same line.
+ BOOST_TEST(dec(inc(123)) == 123);
+}
+
+int main(void) {
     int delta = 10;
- LOCAL_INC_DEC(delta) // Declare local functions on same line using `_ID`.
-
- BOOST_CHECK(dec(inc(123)) == 123);
+ LOCAL_INC_DEC(delta) // Multiple local functions on same line.
+ BOOST_TEST(dec(inc(123)) == 123);
+ f(delta);
+ return boost::report_errors();
 }
 //]
 
-#else
-
-int main(void) { return 0; } // Trivial test.
-
-#endif
+#endif // VARIADIC_MACROS
 

Copied: branches/release/libs/local_function/test/same_line_seq.cpp (from r77411, /trunk/libs/local_function/test/same_line_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/same_line_seq.cpp (original)
+++ branches/release/libs/local_function/test/same_line_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,28 +7,42 @@
 
 #include <boost/local_function.hpp>
 #include <boost/preprocessor/cat.hpp>
-#define BOOST_TEST_MODULE TestSameLineSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <iostream>
     
 #define LOCAL_INC_DEC(offset) \
- int BOOST_LOCAL_FUNCTION_ID( \
- BOOST_PP_CAT(inc, __LINE__) /* unique ID */, 0 /* no TPL */, \
+ int BOOST_LOCAL_FUNCTION_ID(BOOST_PP_CAT(inc, __LINE__), /* unique ID */ \
             (const bind offset) (const int x) ) { \
         return x + offset; \
     } BOOST_LOCAL_FUNCTION_NAME(inc) \
     \
- int BOOST_LOCAL_FUNCTION_ID( \
- BOOST_PP_CAT(dec, __LINE__) /* unique ID */, 0 /* no TPL */, \
+ int BOOST_LOCAL_FUNCTION_ID(BOOST_PP_CAT(dec, __LINE__), \
             (const bind offset) (const int x) ) { \
         return x - offset; \
     } BOOST_LOCAL_FUNCTION_NAME(dec)
 
-BOOST_AUTO_TEST_CASE(test_same_line_seq)
-{
+#define LOCAL_INC_DEC_TPL(offset) \
+ T BOOST_LOCAL_FUNCTION_ID_TPL(BOOST_PP_CAT(inc, __LINE__), \
+ (const bind offset) (const T x) ) { \
+ return x + offset; \
+ } BOOST_LOCAL_FUNCTION_NAME_TPL(inc) \
+ \
+ T BOOST_LOCAL_FUNCTION_ID_TPL(BOOST_PP_CAT(dec, __LINE__), \
+ (const bind offset) (const T x) ) { \
+ return x - offset; \
+ } BOOST_LOCAL_FUNCTION_NAME_TPL(dec)
+
+template<typename T>
+void f(T& delta) {
+ LOCAL_INC_DEC_TPL(delta) // Multiple local functions on same line.
+ BOOST_TEST(dec(inc(123)) == 123);
+}
+
+int main(void) {
     int delta = 10;
     LOCAL_INC_DEC(delta) // Declare local functions on same line using `_ID`.
-
- BOOST_CHECK(dec(inc(123)) == 123);
+ BOOST_TEST(dec(inc(123)) == 123);
+ f(delta);
+ return boost::report_errors();
 }
 

Deleted: /trunk/libs/local_function/test/seq.cpp
==============================================================================
--- /trunk/libs/local_function/test/seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,166 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/local_function
-
-#include <boost/local_function.hpp>
-
-//[seq
-struct s {
- void f(double p = 1.23, double q = -1.23) {
- { // Only params.
- void BOOST_LOCAL_FUNCTION( (int x) (int y)(default 0) ) {
- } BOOST_LOCAL_FUNCTION_NAME(l)
- l(1);
- }
- { // Only const binds.
- int a, b;
-
- const int& BOOST_LOCAL_FUNCTION( (const bind a)
- (const bind& b) (const bind& p) (const bind q) ) {
- return b;
- } BOOST_LOCAL_FUNCTION_NAME(l)
- l();
-
- const s& BOOST_LOCAL_FUNCTION( (const bind this_) ) {
- return *this_;
- } BOOST_LOCAL_FUNCTION_NAME(t)
- t();
-
- const int BOOST_LOCAL_FUNCTION( (const bind a)
- (const bind& b) (const bind& p) (const bind q)
- (const bind this_) ) {
- return a;
- } BOOST_LOCAL_FUNCTION_NAME(lt)
- lt();
- }
- { // Only plain binds.
- int c, d;
-
- int& BOOST_LOCAL_FUNCTION( (bind c) (bind& d)
- (bind& p) (bind& q) ) {
- return d;
- } BOOST_LOCAL_FUNCTION_NAME(l)
- l();
-
- s& BOOST_LOCAL_FUNCTION( (bind this_) ) {
- return *this_;
- } BOOST_LOCAL_FUNCTION_NAME(t)
- t();
-
- int BOOST_LOCAL_FUNCTION( (bind c) (bind& d)
- (bind& p) (bind& q) (bind this_) ) {
- return c;
- } BOOST_LOCAL_FUNCTION_NAME(lt)
- lt();
- }
-
- { // Both params and const binds.
- int a, b;
-
- void BOOST_LOCAL_FUNCTION( (const bind a) (const bind& b)
- (const bind& p) (const bind q)
- (int x) (int y)(default 0) ) {
- } BOOST_LOCAL_FUNCTION_NAME(l)
- l(1);
-
- void BOOST_LOCAL_FUNCTION( (const bind this_)
- (int x) (int y)(default 0) ) {
- } BOOST_LOCAL_FUNCTION_NAME(t)
- t(1);
-
- void BOOST_LOCAL_FUNCTION( (const bind a) (const bind this_)
- (const bind& b) (const bind& p) (const bind q)
- (int x) (int y)(default 0) ) {
- } BOOST_LOCAL_FUNCTION_NAME(lt)
- lt(1);
- }
- { // Both params and plain binds.
- int c, d;
-
- void BOOST_LOCAL_FUNCTION( (bind c) (bind& d) (bind& p) (bind q)
- (int x) (int y)(default 0) ) {
- } BOOST_LOCAL_FUNCTION_NAME(l)
- l(1);
-
- void BOOST_LOCAL_FUNCTION( (bind this_)
- (int x) (int y)(default 0) ) {
- } BOOST_LOCAL_FUNCTION_NAME(t)
- t(1);
-
- void BOOST_LOCAL_FUNCTION( (bind c) (bind& d)
- (bind& p) (bind this_) (bind q)
- (int x) (int y)(default 0) ) {
- } BOOST_LOCAL_FUNCTION_NAME(lt)
- lt(1);
- }
- { // Both const and plain binds.
- int a, b, c, d;
-
- void BOOST_LOCAL_FUNCTION( (const bind a) (const bind& b)
- (const bind p) (bind c) (bind& d) (bind q) ) {
- } BOOST_LOCAL_FUNCTION_NAME(l)
- l();
-
- void BOOST_LOCAL_FUNCTION( (const bind this_)
- (bind c) (bind& d) (bind q) ) {
- } BOOST_LOCAL_FUNCTION_NAME(ct)
- ct();
- void BOOST_LOCAL_FUNCTION( (const bind this_)
- (const bind a) (const bind& b) (const bind p)
- (bind c) (bind& d) (bind q) ) {
- } BOOST_LOCAL_FUNCTION_NAME(lct)
- lct();
-
- void BOOST_LOCAL_FUNCTION( (const bind a) (const bind& b)
- (const bind p) (bind this_) ) {
- } BOOST_LOCAL_FUNCTION_NAME(pt)
- pt();
- void BOOST_LOCAL_FUNCTION( (const bind a) (const bind& b)
- (const bind p) (bind c) (bind this_) (bind& d) (bind q) ) {
- } BOOST_LOCAL_FUNCTION_NAME(lpt)
- lpt();
- }
-
- { // All params, const binds, and plain binds.
- int a, b, c, d;
-
- void BOOST_LOCAL_FUNCTION(
- (const bind a) (const bind& b) (const bind& p)
- (bind c) (bind& d) (bind& q) (int x) (int y)(default 0) ) {
- } BOOST_LOCAL_FUNCTION_NAME(l)
- l(1);
-
- void BOOST_LOCAL_FUNCTION( (const bind this_)
- (bind c) (bind& d) (bind& q)
- (int x) (int y)(default 0) ) {
- } BOOST_LOCAL_FUNCTION_NAME(ct)
- ct(1);
- void BOOST_LOCAL_FUNCTION(
- (const bind a) (const bind& b) (const bind& p)
- (bind this_) (int x) (int y)(default 0) ) {
- } BOOST_LOCAL_FUNCTION_NAME(pt)
- pt(1);
-
- void BOOST_LOCAL_FUNCTION( (const bind a) (const bind this_)
- (const bind& b) (const bind& p) (bind c) (bind& d)
- (bind& q) (int x) (int y)(default 0) ) {
- } BOOST_LOCAL_FUNCTION_NAME(lct)
- lct(1);
- void BOOST_LOCAL_FUNCTION( (const bind a) (const bind& b)
- (const bind& p) (bind c) (bind& d) (bind this_) (bind& q)
- (int x) (int y)(default 0) ) {
- } BOOST_LOCAL_FUNCTION_NAME(lpt)
- lpt(1);
- }
- }
-};
-//]
-
-int main(void) {
- s().f();
- return 0;
-}
-

Modified: branches/release/libs/local_function/test/ten_void.cpp
==============================================================================
--- /trunk/libs/local_function/test/ten_void.cpp (original)
+++ branches/release/libs/local_function/test/ten_void.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,17 +6,16 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestTenVoid
-#include <boost/test/unit_test.hpp>
-#include <iostream>
+#include <boost/detail/lightweight_test.hpp>
 
-BOOST_AUTO_TEST_CASE( test_ten_void ) {
+int main(void) {
     //[ten_void
     int BOOST_LOCAL_FUNCTION(void) { // No parameter.
         return 10;
     } BOOST_LOCAL_FUNCTION_NAME(ten)
 
- BOOST_CHECK( ten() == 10 );
+ BOOST_TEST(ten() == 10);
     //]
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/transform.cpp
==============================================================================
--- /trunk/libs/local_function/test/transform.cpp (original)
+++ branches/release/libs/local_function/test/transform.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,20 +5,24 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestTranform
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 #include <vector>
 
-BOOST_AUTO_TEST_CASE( test_transform ) {
+int main(void) {
     //[transform
     int offset = 5;
     std::vector<int> v;
     std::vector<int> w;
 
     for(int i = 1; i <= 2; ++i) v.push_back(i * 10);
- BOOST_CHECK( v[0] == 10 ); BOOST_CHECK( v[1] == 20 );
+ BOOST_TEST(v[0] == 10); BOOST_TEST(v[1] == 20);
     w.resize(v.size());
 
     int BOOST_LOCAL_FUNCTION(const bind& offset, int i) {
@@ -26,7 +30,7 @@
     } BOOST_LOCAL_FUNCTION_NAME(inc)
     
     std::transform(v.begin(), v.end(), w.begin(), inc);
- BOOST_CHECK( w[0] == 16 ); BOOST_CHECK( w[1] == 26 );
+ BOOST_TEST(w[0] == 16); BOOST_TEST(w[1] == 26);
 
     int BOOST_LOCAL_FUNCTION(bind& inc, int i, int j) {
         return inc(i + j); // Call the other bound local function.
@@ -34,7 +38,10 @@
     
     offset = 0;
     std::transform(v.begin(), v.end(), w.begin(), v.begin(), inc_sum);
- BOOST_CHECK( v[0] == 27 ); BOOST_CHECK( v[1] == 47 );
+ BOOST_TEST(v[0] == 27); BOOST_TEST(v[1] == 47);
     //]
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/transform_seq.cpp (from r77097, /trunk/libs/local_function/test/transform_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/transform_seq.cpp (original)
+++ branches/release/libs/local_function/test/transform_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,18 +6,17 @@
 // Home at http://www.boost.org/libs/local_function
 
 #include <boost/local_function.hpp>
-#define BOOST_TEST_MODULE TestTranformSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 #include <vector>
 
-BOOST_AUTO_TEST_CASE(test_transform_seq) {
+int main(void) {
     int offset = 5;
     std::vector<int> v;
     std::vector<int> w;
 
     for(int i = 1; i <= 2; ++i) v.push_back(i * 10);
- BOOST_CHECK(v[0] == 10); BOOST_CHECK(v[1] == 20);
+ BOOST_TEST(v[0] == 10); BOOST_TEST(v[1] == 20);
     w.resize(v.size());
 
     int BOOST_LOCAL_FUNCTION( (const bind& offset) (int i) ) {
@@ -25,7 +24,7 @@
     } BOOST_LOCAL_FUNCTION_NAME(inc)
     
     std::transform(v.begin(), v.end(), w.begin(), inc);
- BOOST_CHECK(w[0] == 16); BOOST_CHECK(w[1] == 26);
+ BOOST_TEST(w[0] == 16); BOOST_TEST(w[1] == 26);
 
     int BOOST_LOCAL_FUNCTION( (bind& inc) (int i) (int j) ) {
         return inc(i + j);
@@ -33,6 +32,8 @@
     
     offset = 0;
     std::transform(v.begin(), v.end(), w.begin(), v.begin(), inc_sum);
- BOOST_CHECK(v[0] == 27); BOOST_CHECK(v[1] == 47);
+ BOOST_TEST(v[0] == 27); BOOST_TEST(v[1] == 47);
+
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/typeof.cpp
==============================================================================
--- /trunk/libs/local_function/test/typeof.cpp (original)
+++ branches/release/libs/local_function/test/typeof.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,23 +5,27 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include "addable.hpp"
 #include <boost/local_function.hpp>
 #include <boost/type_traits/remove_reference.hpp>
 #include <boost/concept_check.hpp>
-#define BOOST_TEST_MODULE TestTypeof
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 
-BOOST_AUTO_TEST_CASE( test_typeof ) {
+int main(void) {
     //[typeof
     int sum = 0, factor = 10;
 
     void BOOST_LOCAL_FUNCTION(const bind factor, bind& sum, int num) {
- // Typeof for concept checking.
+ // Type-of for concept checking.
         BOOST_CONCEPT_ASSERT((Addable<boost::remove_reference<
                 BOOST_LOCAL_FUNCTION_TYPEOF(sum)>::type>));
- // Typeof for declarations.
+ // Type-of for declarations.
         boost::remove_reference<BOOST_LOCAL_FUNCTION_TYPEOF(
                 factor)>::type mult = factor * num;
         sum += mult;
@@ -29,6 +33,9 @@
 
     add(6);
     //]
- BOOST_CHECK( sum == 60 );
+ BOOST_TEST(sum == 60);
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/typeof_seq.cpp (from r77097, /trunk/libs/local_function/test/typeof_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/typeof_seq.cpp (original)
+++ branches/release/libs/local_function/test/typeof_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -9,11 +9,10 @@
 #include <boost/local_function.hpp>
 #include <boost/type_traits/remove_reference.hpp>
 #include <boost/concept_check.hpp>
-#define BOOST_TEST_MODULE TestTypeofSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 
-BOOST_AUTO_TEST_CASE(test_typeof_seq) {
+int main(void) {
     int sum = 0, factor = 10;
 
     void BOOST_LOCAL_FUNCTION( (const bind factor) (bind& sum) (int num) ) {
@@ -25,6 +24,7 @@
     } BOOST_LOCAL_FUNCTION_NAME(add)
 
     add(6);
- BOOST_CHECK(sum == 60);
+ BOOST_TEST(sum == 60);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/local_function/test/typeof_template.cpp
==============================================================================
--- /trunk/libs/local_function/test/typeof_template.cpp (original)
+++ branches/release/libs/local_function/test/typeof_template.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -5,12 +5,16 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/local_function
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include "addable.hpp"
 #include <boost/local_function.hpp>
 #include <boost/type_traits/remove_reference.hpp>
 #include <boost/concept_check.hpp>
-#define BOOST_TEST_MODULE TestTypeofTemplate
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 
 //[typeof_template
@@ -23,14 +27,17 @@
         BOOST_CONCEPT_ASSERT((Addable<typename boost::remove_reference<
                 BOOST_LOCAL_FUNCTION_TYPEOF(sum)>::type>));
         sum += factor * num;
- } BOOST_LOCAL_FUNCTION_NAME(add)
+ } BOOST_LOCAL_FUNCTION_NAME_TPL(add)
 
     add(6);
     return sum;
 }
 //]
 
-BOOST_AUTO_TEST_CASE( test_typeof_template ) {
- BOOST_CHECK( calculate(10) == 60 );
+int main(void) {
+ BOOST_TEST(calculate(10) == 60);
+ return boost::report_errors();
 }
 
+#endif // VARIADIC_MACROS
+

Copied: branches/release/libs/local_function/test/typeof_template_seq.cpp (from r77097, /trunk/libs/local_function/test/typeof_template_seq.cpp)
==============================================================================
--- /trunk/libs/local_function/test/typeof_template_seq.cpp (original)
+++ branches/release/libs/local_function/test/typeof_template_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -9,8 +9,7 @@
 #include <boost/local_function.hpp>
 #include <boost/type_traits/remove_reference.hpp>
 #include <boost/concept_check.hpp>
-#define BOOST_TEST_MODULE TestTypeofTemplateSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <algorithm>
 
 template<typename T>
@@ -21,13 +20,14 @@
         BOOST_CONCEPT_ASSERT((Addable<typename boost::remove_reference<
                 BOOST_LOCAL_FUNCTION_TYPEOF(sum)>::type>));
         sum += factor * num;
- } BOOST_LOCAL_FUNCTION_NAME(add)
+ } BOOST_LOCAL_FUNCTION_NAME_TPL(add)
 
     add(6);
     return sum;
 }
 
-BOOST_AUTO_TEST_CASE(test_typeof_template_seq) {
- BOOST_CHECK(calculate(10) == 60);
+int main(void) {
+ BOOST_TEST(calculate(10) == 60);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/maintainers.txt
==============================================================================
--- branches/release/libs/maintainers.txt (original)
+++ branches/release/libs/maintainers.txt 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -39,6 +39,7 @@
 functional/factory Tobias Schwinger <tschwinger -at- isonews2.com>
 functional/forward Tobias Schwinger <tschwinger -at- isonews2.com>
 functional/hash Daniel James <dnljms -at- gmail.com>
+functional/overloaded_function Lorenzo Caminiti <lorcaminiti -at- gmail.com>
 fusion Joel de Guzman <joel -at- boost-consulting.com>, Dan Marsden <danmarsden -at- yahoo.co.uk>, Tobias Schwinger <tschwinger -at- isonews2.com>
 function_types Tobias Schwinger <tschwinger -at- isonews2.com>
 geometry Barend Gehrels<barend -at- xs4all.nl>, Bruno Lalande <bruno.lalande -at- gmail.com>, Mateusz Loskot <mateusz -at- loskot.net>
@@ -53,6 +54,7 @@
 iostreams Jonathan Turkanis <turkanis -at- coderage.com>
 iterator David Abrahams <dave -at- boost-consulting.com>, Thomas Witt <witt - at - acm.org>
 lambda Jaakko Jarvi <jarvi -at- cs.tamu.edu>
+local_function Lorenzo Caminiti <lorcaminiti -at- gmail.com>
 locale Artyom Beilis <artyomtnk -at- yahoo.com>
 logic Douglas Gregor <dgregor -at- cs.indiana.edu>
 math Hubert Holin <Hubert.Holin -at- meteo.fr>, John Maddock <john -at- johnmaddock.co.uk>
@@ -82,7 +84,7 @@
 ratio Vicente J. Botet Escriba <vicente.botet -at- wanadoo.fr>
 rational Jonathan Turkanis <turkanis -at- coderage.com>
 regex John Maddock <john -at- johnmaddock.co.uk>
-scope_exit Alexander Nasonov <alexander.nasonov -at- gmail.com>
+scope_exit Alexander Nasonov <alexander.nasonov -at- gmail.com>, Lorenzo Caminiti <lorcaminiti -at- gmail.com>
 serialization Robert Ramey <ramey -at- rrsd.com>
 signals Douglas Gregor <dgregor -at- cs.indiana.edu>
 signals2 Frank Mori Hess <fmhess -at- users.sourceforge.net>
@@ -101,8 +103,9 @@
 units Matthias Schabel <boost -at- schabel-family.org>, Steven Watanabe <steven -at- providere-consulting.com>
 unordered Daniel James <dnljms -at- gmail.com>
 utility
-utility/result_of Daniel Walker <daniel.j.walker -at- gmail.com>
 utility/enable_if Jaakko Jarvi <jarvi -at- cs.tamu.edu>, Jeremiah Willcock <jewillco -at- osl.iu.edu>
+utility/identity_type Lorenzo Caminiti <lorcaminiti -at- gmail.com>
+utility/result_of Daniel Walker <daniel.j.walker -at- gmail.com>
 utility/swap Joseph Gauterin <joseph.gauterin -at- googlemail.com>
 uuid Andy Tompkins <atompkins -at- fastmail.fm>
 variant Eric Friedman <ericbrandon -at- gmail.com>

Modified: branches/release/libs/scope_exit/doc/Jamfile.v2
==============================================================================
--- branches/release/libs/scope_exit/doc/Jamfile.v2 (original)
+++ branches/release/libs/scope_exit/doc/Jamfile.v2 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1,15 +1,30 @@
 
-# Copyright 2006 Alexander Nasonov.
-# 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)
-
-using quickbook ;
-
-xml scope_exit : scope_exit.qbk ;
-boostbook standalone : scope_exit
- :
- # Path for links to Boost:
- <xsl:param>boost.root=../../../..
+# Copyright (C) 2006-2009, 2012 Alexander Nasonov
+# Copyright (C) 2012 Lorenzo Caminiti
+# Distributed under the Boost Software License, Version 1.0
+# (see accompanying file LICENSE_1_0.txt or a copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+# Home at http://www.boost.org/libs/scope_exit
+
+import quickbook ;
+using boostbook ;
+
+doxygen reference
+ : ../../../boost/scope_exit.hpp
+ : <reftitle>"Reference"
+ <doxygen:param>PREDEFINED="DOXYGEN"
+ <doxygen:param>QUIET=YES
+ <doxygen:param>WARN_IF_UNDOCUMENTED=NO
+ <doxygen:param>HIDE_UNDOC_MEMBERS=YES
+ <doxygen:param>HIDE_UNDOC_CLASSES=YES
+ <doxygen:param>ALIASES=" Params=\"<b>Parameters:</b> <table border="0">\" Param{2}=\"<tr><td><b><tt>\\1</tt></b></td><td>\\2</td></tr>\" EndParams=\"</table>\" Returns=\"<b>Returns:</b>\" Note=\"<b>Note:</b>\" Warning=\"<b>Warning:</b>\" See=\"<b>See:</b>\" RefSect{2}=\"\\xmlonly<link linkend='scope_exit.\\1'>\\2</link>\\endxmlonly\" RefClass{1}=\"\\xmlonly<computeroutput><classname alt='\\1'>\\1</classname></computeroutput>\\endxmlonly\" RefFunc{1}=\"\\xmlonly<computeroutput><functionname alt='\\1'>\\1</functionname></computeroutput>\\endxmlonly\" RefMacro{1}=\"\\xmlonly<computeroutput><macroname alt='\\1'>\\1</macroname></computeroutput>\\endxmlonly\" "
+ ;
+
+xml qbk : scope_exit.qbk : <dependency>reference ;
+
+boostbook doc : qbk
+ : <xsl:param>boost.root=../../../..
+ <xsl:param>boost.defaults=Boost
         <format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/scope_exit/doc/html
- ;
+ ;
 

Copied: branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html (from r77042, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html)
==============================================================================
--- /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html (original)
+++ branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT.html 2012-05-23 21:35:04 EDT (Wed, 23 May 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="id814612"></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>
@@ -43,7 +43,7 @@
         <span class="special">...</span>
     <span class="special">}</span>
 </pre>
-<p>The enclosing scope must be local. If multiple scope exits are declared within the same enclosing scope, the scope exit bodies are executed in the reversed order of their declarations. Note how the end of the scope exit body must be marked by <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a></code> (or by a <code class="computeroutput">;</code> but only on C++11).</p>
+<p>The enclosing scope must be local. If multiple scope exits are declared within the same enclosing scope, the scope exit bodies are executed in the reversed order of their declarations. Note how the end of the scope exit body must be marked by <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>
 <p><span class="bold"><strong>Parameters:</strong></span> </p>
 <div class="informaltable"><table class="table">
 <colgroup>
@@ -52,7 +52,7 @@
 </colgroup>
 <tbody><tr>
 <td><span class="bold"><strong><code class="computeroutput">capture_list</code></strong></span></td>
-<td>On compilers that support variadic macros, the capture list syntax is defined by the following grammar: <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <span class="identifier">capture_list</span><span class="special">:</span>
+<td>On compilers that support variadic macros (see also Boost.Config <code class="computeroutput">BOOST_NO_VARIADIC_MACROS</code>), the capture list syntax is defined by the following grammar: <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <span class="identifier">capture_list</span><span class="special">:</span>
             <span class="keyword">void</span> <span class="special">|</span> <span class="identifier">capture_tuple</span> <span class="special">|</span> <span class="identifier">capture_sequence</span>
     <span class="identifier">capture_tuple</span><span class="special">:</span>
             <span class="identifier">capture</span><span class="special">,</span> <span class="identifier">capture</span><span class="special">,</span> <span class="special">...</span>
@@ -62,23 +62,24 @@
             <span class="special">[</span><span class="special">&amp;</span><span class="special">]</span><span class="identifier">variable</span> <span class="special">|</span> <span class="identifier">this_</span>
 </pre> On compilers that do not support variadic macros, <code class="computeroutput">capture_tuple</code> cannot be used: <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <span class="identifier">capture_list</span><span class="special">:</span>
             <span class="keyword">void</span> <span class="special">|</span> <span class="identifier">capture_sequence</span>
-</pre> Finally, on C++11 compilers <code class="computeroutput">this</code> can be used instead of <code class="computeroutput">this_</code>: <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <span class="identifier">capture</span><span class="special">:</span>
+</pre> Furthermore, if <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS.html" title="Macro BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS">BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS</a></code> is defined on C++11 compilers that support lambda functions (i.e., Boost.Config's <code class="computeroutput">BOOST_NO_LAMBDAS</code> is not defined) then a semicolon <code class="computeroutput">;</code> can be used instead of <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a></code> and <code class="computeroutput">this</code> can be used instead of <code class="computeroutput">this_</code>: <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <span class="identifier">capture</span><span class="special">:</span>
             <span class="special">[</span><span class="special">&amp;</span><span class="special">]</span><span class="identifier">variable</span> <span class="special">|</span> <span class="identifier">this_</span> <span class="special">|</span> <span class="keyword">this</span>
-</pre>Lexical conventions: <code class="computeroutput">token1 | token2</code> means either <code class="computeroutput">token1</code> or <code class="computeroutput">token2</code>; <code class="computeroutput">[token]</code> means either <code class="computeroutput">token</code> or nothing; <code class="computeroutput">{expression}</code> means the token resulting from the expression. </td>
+</pre>(Lexical conventions: <code class="computeroutput">token1 | token2</code> means either <code class="computeroutput">token1</code> or <code class="computeroutput">token2</code>; <code class="computeroutput">[token]</code> means either <code class="computeroutput">token</code> or nothing; <code class="computeroutput">{expression}</code> means the tokens resulting from the expression.) </td>
 </tr></tbody>
 </table></div>
 <p>
 </p>
-<p>Note that on compilers with variadic macro support (most of moder compliers and all C++11 compilers), the capture list can be specified as a comma-separated list of tokens. On all compilers, the same macro <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> also allows to specify the capture list as a Boost.Preprocessor sequence of tokens (for supporting compilers without variadic macros and for backward compatibility with older versions of this library).</p>
+<p>Note that on compilers that support variadic macros (most of moder compliers and all C++11 compilers), the capture list can be specified as a comma-separated list of tokens (this is the preferred syntax). However, on all compilers the same macro <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> also allows to specify the capture list as a Boost.Preprocessor sequence of tokens (for supporting compilers without variadic macros and for backward compatibility with older versions of this library).</p>
 <p>The name <code class="computeroutput">variable</code> of each captured variable must be a valid name in the enclosing scope and it must appear exactly once in the capture list. If a capture starts with the ampersand sign <code class="computeroutput">&amp;</code>, the corresponding variable will be available by reference within the scope exit body; otherwise, a copy of the variable will be made at the point of the scope exit declaration and that copy will be available inside the scope exit body (in this case, the variable's type must be <code class="computeroutput">CopyConstructible</code>).</p>
-<p>From within a member function, the object <code class="computeroutput">this</code> can be captured using the special symbol <code class="computeroutput">this_</code> in both the capture list and the scope exit body (using <code class="computeroutput">this</code> instead of <code class="computeroutput">this_</code> in the scope exit body leads to undefined behaviour). On C++11 it is possible (but not required) to use <code class="computeroutput">this</code> instead of <code class="computeroutput">this_</code>.</p>
+<p>From within a member function, the object <code class="computeroutput">this</code> can be captured using the special name <code class="computeroutput">this_</code> in both the capture list and the scope exit body (using <code class="computeroutput">this</code> instead of <code class="computeroutput">this_</code> in the scope exit body leads to undefined behaviour).</p>
 <p>It is possible to capture no variable by specifying the capture list as <code class="computeroutput">void</code> (regardless of variadic macro support).</p>
 <p>Only variables listed in the capture list, static variables, <code class="computeroutput">extern</code> variables, global variables, functions, and enumerations from the enclosing scope can be used inside the scope exit body.</p>
-<p>On various GCC versions the special macro <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> must 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> within templates (this is not necessary on C++11).</p>
-<p>On C++11, it is possible capture all variables in scope without listing their names using the macro <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_ALL.html" title="Macro BOOST_SCOPE_EXIT_ALL">BOOST_SCOPE_EXIT_ALL</a></code>.</p>
+<p>On various GCC versions the special macro <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> must 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> within templates (to maximize portability, it is recommended to always use <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> within templates).</p>
+<p>On C++11, it is possible capture all variables in scope without listing their names one-by-one using the macro <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_ALL.html" title="Macro BOOST_SCOPE_EXIT_ALL">BOOST_SCOPE_EXIT_ALL</a></code>.</p>
+<p>In general, the special macro <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_ID.html" title="Macro BOOST_SCOPE_EXIT_ID">BOOST_SCOPE_EXIT_ID</a></code> must 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> when it is necessary to expand multiple scope exit declarations on the same line.</p>
 <p><span class="bold"><strong>Warning:</strong></span> The implementation executes the scope exit body within a destructor thus the scope exit body must never throw in order to comply with STL exception safety requirements.</p>
-<p><span class="bold"><strong>Note:</strong></span> The implementation uses Boost.Typeof to automatically deduce the types of the captured variables. In order to compile code in type-of emulation mode, Boost.Typeof must be properly configured (see the <a class="link" href="scope_exit/Getting_Started.html" title="Getting Started"> Getting Started</a> section).</p>
-<p><span class="bold"><strong>See:</strong></span> <a class="link" href="scope_exit/Tutorial.html" title="Tutorial">Tutorial</a> section, <a class="link" href="scope_exit/Getting_Started.html" title="Getting Started"> Getting Started</a> section, <a class="link" href="scope_exit/No_Variadic_Macros.html" title="Annex: No Variadic Macros"> No Variadic Macros</a> section, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</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>
+<p><span class="bold"><strong>Note:</strong></span> The implementation uses Boost.Typeof to automatically deduce the types of the captured variables. In order to compile code in type-of emulation mode, all types must be properly registered with Boost.Typeof (see the <a class="link" href="scope_exit/Getting_Started.html" title="Getting Started"> Getting Started</a> section).</p>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="scope_exit/Tutorial.html" title="Tutorial">Tutorial</a> section, <a class="link" href="scope_exit/Getting_Started.html" title="Getting Started"> Getting Started</a> section, <a class="link" href="scope_exit/No_Variadic_Macros.html" title="Annex: No Variadic Macros"> No Variadic Macros</a> section, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</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>, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_ID.html" title="Macro BOOST_SCOPE_EXIT_ID">BOOST_SCOPE_EXIT_ID</a></code>. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

Copied: branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html (from r77042, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html)
==============================================================================
--- /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html (original)
+++ branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_ALL.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,8 +6,8 @@
 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 <link rel="home" href="index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0">
 <link rel="up" href="reference.html#header.boost.scope_exit_hpp" title="Header &lt;boost/scope_exit.hpp&gt;">
-<link rel="prev" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">
-<link rel="next" href="BOOST_SCOPE_EXIT_END.html" title="Macro BOOST_SCOPE_EXIT_END">
+<link rel="prev" href="BOOST_SCOPE_EXIT_TPL_ID.html" title="Macro BOOST_SCOPE_EXIT_TPL_ID">
+<link rel="next" href="BOOST_SCOPE_EXIT_ALL_ID.html" title="Macro BOOST_SCOPE_EXIT_ALL_ID">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_SCOPE_EXIT_TPL.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.scope_exit_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT_END.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_SCOPE_EXIT_TPL_ID.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.scope_exit_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT_ALL_ID.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="refentry">
 <a name="BOOST_SCOPE_EXIT_ALL"></a><div class="titlepage"></div>
@@ -33,8 +33,8 @@
 
 </span>BOOST_SCOPE_EXIT_ALL(capture_list)</pre></div>
 <div class="refsect1">
-<a name="id871573"></a><h2>Description</h2>
-<p>This macro accepts a capture list starting with either <code class="computeroutput">&amp;</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>
+<a name="id816102"></a><h2>Description</h2>
+<p>This macro accepts a capture list starting with either <code class="computeroutput">&amp;</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>
         <span class="identifier">BOOST_SCOPE_EXIT_ALL</span><span class="special">(</span><span class="identifier">capture_list</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// C++11 only.</span>
@@ -43,7 +43,8 @@
         <span class="special">...</span>
     <span class="special">}</span>
 </pre>
-<p><span class="bold"><strong>Warning:</strong></span> This macro is only available on C++11 compilers. It is not defined on non-C++11 compilers so its use on non-C++11 compilers will generate a compiler error.</p>
+<p>Note how the end of the scope exit body declared by this macro must be marked by a semi-column <code class="computeroutput">;</code> (and not by <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>
+<p><span class="bold"><strong>Warning:</strong></span> This macro is only available on C++11 compilers (specifically, on C++11 compilers that do not define the Boost.Config <code class="computeroutput">BOOST_NO_LAMBDAS</code> macro). It is not defined on non-C++11 compilers so its use on non-C++11 compilers will generate a compiler error.</p>
 <p><span class="bold"><strong>Parameters:</strong></span> </p>
 <div class="informaltable"><table class="table">
 <colgroup>
@@ -52,25 +53,30 @@
 </colgroup>
 <tbody><tr>
 <td><span class="bold"><strong><code class="computeroutput">capture_list</code></strong></span></td>
-<td>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">capture_list</span><span class="special">:</span>
+<td>On compilers that support variadic macros (see also Boost.Config <code class="computeroutput">BOOST_NO_VARIADIC_MACROS</code>), the capture list syntax is defined by the following grammar: <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">capture_list</span><span class="special">:</span>
         <span class="identifier">capture_tuple</span> <span class="special">|</span> <span class="identifier">capture_sequence</span>
 <span class="identifier">capture_tuple</span><span class="special">:</span>
         <span class="special">{</span><span class="special">&amp;</span> <span class="special">|</span> <span class="special">=</span><span class="special">}</span> <span class="special">[</span><span class="special">,</span> <span class="identifier">capture</span><span class="special">,</span> <span class="identifier">capture</span><span class="special">,</span> <span class="special">...</span><span class="special">]</span>
 <span class="identifier">capture_sequence</span><span class="special">:</span>
         <span class="special">{</span><span class="special">(</span><span class="special">&amp;</span><span class="special">)</span> <span class="special">|</span> <span class="special">(</span><span class="special">=</span><span class="special">)</span><span class="special">}</span> <span class="special">[</span><span class="special">(</span><span class="identifier">capture</span><span class="special">)</span> <span class="special">(</span><span class="identifier">capture</span><span class="special">)</span> <span class="special">...</span><span class="special">]</span>
 <span class="identifier">capture</span><span class="special">:</span>
- <span class="special">[</span><span class="special">&amp;</span><span class="special">]</span><span class="identifier">variable</span> <span class="special">|</span> <span class="identifier">this_</span> <span class="special">|</span> <span class="keyword">this</span>
-</pre>Lexical conventions: <code class="computeroutput">token1 | token2</code> means either <code class="computeroutput">token1</code> or <code class="computeroutput">token2</code>; <code class="computeroutput">[token]</code> means either <code class="computeroutput">token</code> or nothing; <code class="computeroutput">{expression}</code> means the token resulting from the expression. </td>
+ <span class="special">[</span><span class="special">&amp;</span><span class="special">]</span><span class="identifier">variable</span> <span class="special">|</span> <span class="identifier">this_</span>
+</pre> On compilers that do not support variadic macros, <code class="computeroutput">capture_tuple</code> cannot be used: <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <span class="identifier">capture_list</span><span class="special">:</span>
+ <span class="keyword">void</span> <span class="special">|</span> <span class="identifier">capture_sequence</span>
+</pre> Furthermore, on C++11 compilers that support the use of <code class="computeroutput">typename</code> outside templates, also <code class="computeroutput">this</code> can be used to capture the object at member function scope: <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <span class="identifier">capture</span><span class="special">:</span>
+ <span class="special">[</span><span class="special">&amp;</span><span class="special">]</span><span class="identifier">variable</span> <span class="special">|</span> <span class="identifier">this_</span> <span class="special">|</span> <span class="keyword">this</span>
+</pre>(Lexical conventions: <code class="computeroutput">token1 | token2</code> means either <code class="computeroutput">token1</code> or <code class="computeroutput">token2</code>; <code class="computeroutput">[token]</code> means either <code class="computeroutput">token</code> or nothing; <code class="computeroutput">{expression}</code> means the token resulting from the expression.) </td>
 </tr></tbody>
 </table></div>
 <p>
 </p>
-<p>For this macro, the capture list must always contain at least the leading <code class="computeroutput">&amp;</code> or <code class="computeroutput">=</code> so it can never be <code class="computeroutput">void</code>.</p>
-<p>Note that on compilers with variadic macro support (which should be all C++11 compilers), the capture list can be specified as a comma-separated list. On all compilers, the same macro <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_ALL.html" title="Macro BOOST_SCOPE_EXIT_ALL">BOOST_SCOPE_EXIT_ALL</a></code> also allows to specify the capture list as a Boost.Preprocessor sequence (to allow to use a syntax consistent with the one of <code class="computeroutput">BOOST_SCOPE_EXIT</code> when used on compilers without variadic macro support). The scope exit body declared by this macro can be terminated equivalently by either a semi-column <code class="computeroutput">;</code> or by the macro <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a></code>. The <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_ALL.html" title="Macro BOOST_SCOPE_EXIT_ALL">BOOST_SCOPE_EXIT_ALL</a></code> macro
 is only available on C++11 where the terminating semi-column <code class="computeroutput">;</code> can always be used without worrying about portability with C++03 (see <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a></code> for more information). Similarly, this macro can always use <code class="computeroutput">this</code> instead of <code class="computeroutput">this_</code> to capture the enclosing object without worrying about portability with C++03 because this macro is only available on C++11 compilers.</p>
-<p><span class="bold"><strong>Note:</strong></span> In summary, this macro can take advantage of all syntax improvements allowed by C++11 but it optionally supports the same syntax required by C++03 so programmers can always program both <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_ALL.html" title="Macro BOOST_SCOPE_EXIT_ALL">BOOST_SCOPE_EXIT_ALL</a></code> and <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> using the same syntax and for all compilers if they wish to do so.</p>
+<p>Note that on compilers with variadic macro support (which should be all C++11 compilers), the capture list can be specified as a comma-separated list. On all compilers, the same macro <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_ALL.html" title="Macro BOOST_SCOPE_EXIT_ALL">BOOST_SCOPE_EXIT_ALL</a></code> also allows to specify the capture list as a Boost.Preprocessor sequence.</p>
+<p>The capture list must always contain at least the leading <code class="computeroutput">&amp;</code> or <code class="computeroutput">=</code> so it can never be <code class="computeroutput">void</code> (<code class="computeroutput">BOOST_SCOPE_EXIT(void)</code> should be used to program scope exits with an empty capture list).</p>
+<p>In general, the special macro <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_ALL_ID.html" title="Macro BOOST_SCOPE_EXIT_ALL_ID">BOOST_SCOPE_EXIT_ALL_ID</a></code> must be used instead of <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_ALL.html" title="Macro BOOST_SCOPE_EXIT_ALL">BOOST_SCOPE_EXIT_ALL</a></code> when it is necessary to expand multiple scope exit declarations on the same line.</p>
+<p><span class="bold"><strong>Warning:</strong></span> This macro capture list follows the exact same syntax of C++11 lambda captures which is unfortunately different from the syntax of <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> captures (unless programmers define the <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS.html" title="Macro BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS">BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS</a></code> macro). For example, like C++11 lambda functions, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_ALL.html" title="Macro BOOST_SCOPE_EXIT_ALL">BOOST_SCOPE_EXIT_ALL</a></code> requires to capture data members by capturing the object <code class="computeroutput">this</code> while <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> allows to capture data members direct
ly and without capturing the object.</p>
 <p><span class="bold"><strong>Warning:</strong></span> The implementation executes the scope exit body within a destructor thus the scope exit body must never throw in order to comply with STL exception safety requirements.</p>
-<p><span class="bold"><strong>See:</strong></span> <a class="link" href="scope_exit/Tutorial.html" title="Tutorial">Tutorial</a> section, <a class="link" href="scope_exit/No_Variadic_Macros.html" title="Annex: No Variadic Macros"> No Variadic Macros</a> section, <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_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a></code>. </p>
+<p><span class="bold"><strong>Note:</strong></span> This macro can always be used also within templates (so there is no need for a <code class="computeroutput">BOOST_SCOPE_EXIT_ALL_TPL</code> macro).</p>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="scope_exit/Tutorial.html" title="Tutorial">Tutorial</a> section, <a class="link" href="scope_exit/No_Variadic_Macros.html" title="Annex: No Variadic Macros"> No Variadic Macros</a> section, <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_ID.html" title="Macro BOOST_SCOPE_EXIT_ALL_ID">BOOST_SCOPE_EXIT_ALL_ID</a></code>. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
@@ -83,7 +89,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_SCOPE_EXIT_TPL.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.scope_exit_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT_END.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_SCOPE_EXIT_TPL_ID.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.scope_exit_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT_ALL_ID.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Copied: branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html (from r77042, /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)
+++ branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html 2012-05-23 21:35:04 EDT (Wed, 23 May 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="id869663"></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>

Copied: branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS.html (from r77930, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS.html)
==============================================================================
--- /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS.html (original)
+++ branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -33,7 +33,7 @@
 
 </span>BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS</pre></div>
 <div class="refsect1">
-<a name="id861468"></a><h2>Description</h2>
+<a name="id818882"></a><h2>Description</h2>
 <p>If programmers define this configuration macro on a C++11 compiler for which the Boost.Config macro <code class="computeroutput">BOOST_NO_LAMBDAS</code> is not defined, the <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> and <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> macros will use C++11 lambda functions to declare scope exits. By default this macro is not defined.</p>
 <p><span class="bold"><strong>Warning:</strong></span> When scope exits are implemented using lambda functions, the syntax of the capture list follows the exact same syntax of C++11 lambda captures which is in general different from the legacy capture syntax of this library. For example, C++11 lambdas require to capture data members by capturing the object <code class="computeroutput">this</code> while this library always allowed to capture data members directly. Therefore, when this configuration macro is defined, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> and <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> are no longer backward compatible (and this is why this macro is not defined by default).</p>
 <p>A semicolon <code class="computeroutput">;</code> can be used instead of <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a></code> when this configuration macro is defined (but it is recommended to always use <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a></code> so to maximize portability).</p>

Copied: branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDA_IMPL.html (from r77436, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDA_IMPL.html)
==============================================================================
--- /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDA_IMPL.html (original)
+++ branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDA_IMPL.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -33,7 +33,7 @@
 
 </span>BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDA_IMPL</pre></div>
 <div class="refsect1">
-<a name="id891389"></a><h2>Description</h2>
+<a name="id854544"></a><h2>Description</h2>
 <p>If programmers define this configuration macro on a C++11 compiler, lambda functions will be used to implement the <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> macro. By default this macro is not defined.</p>
 <p><span class="bold"><strong>Note:</strong></span> When <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> is implemented using lambda, the semantics of its variable captures follow the semantics of C++11 lambda captures which are in general different from the legacy capture semantics of this library (e.g., C++11 lambdas require to capture data members via capturing the object <code class="computeroutput">this</code> while this library always allowed to capture data members directly). Therefore, when this configuration macro is defined, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> is no longer backward compatible.</p>
 <p>A semicolon <code class="computeroutput">;</code> can simply be used instead of <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a></code> when this configuration macro is defined.</p>

Copied: branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html (from r77042, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html)
==============================================================================
--- /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html (original)
+++ branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_END.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,8 +6,8 @@
 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 <link rel="home" href="index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0">
 <link rel="up" href="reference.html#header.boost.scope_exit_hpp" title="Header &lt;boost/scope_exit.hpp&gt;">
-<link rel="prev" href="BOOST_SCOPE_EXIT_ALL.html" title="Macro BOOST_SCOPE_EXIT_ALL">
-<link rel="next" href="BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html" title="Macro BOOST_SCOPE_EXIT_CONFIG_NO_CPP11">
+<link rel="prev" href="BOOST_SCOPE_EXIT_ALL_ID.html" title="Macro BOOST_SCOPE_EXIT_ALL_ID">
+<link rel="next" href="BOOST_SCOPE_EXIT_END_ID.html" title="Macro BOOST_SCOPE_EXIT_END_ID">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_SCOPE_EXIT_ALL.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.scope_exit_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_SCOPE_EXIT_ALL_ID.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.scope_exit_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT_END_ID.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="refentry">
 <a name="BOOST_SCOPE_EXIT_END"></a><div class="titlepage"></div>
@@ -33,8 +33,8 @@
 
 </span>BOOST_SCOPE_EXIT_END</pre></div>
 <div class="refsect1">
-<a name="id872111"></a><h2>Description</h2>
-<p>This macro must follow the closing curly bracket <code class="computeroutput">}</code> that ends the scope exit body:</p>
+<a name="id816915"></a><h2>Description</h2>
+<p>This macro must follow the closing curly bracket <code class="computeroutput">}</code> that ends the body of either <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> or <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code>:</p>
 <pre class="programlisting"> <span class="special">{</span> <span class="comment">// Some local scope.</span>
         <span class="special">...</span>
         <span class="identifier">BOOST_SCOPE_EXIT</span><span class="special">(</span><span class="identifier">capture_list</span><span class="special">)</span> <span class="special">{</span>
@@ -43,17 +43,9 @@
         <span class="special">...</span>
     <span class="special">}</span>
 </pre>
-<p>On C++11, this macro is not necessary and it can be replaced by a semi-column <code class="computeroutput">;</code> : </p>
-<pre class="programlisting"> <span class="special">{</span> <span class="comment">// Some local scope.</span>
- <span class="special">...</span>
- <span class="identifier">BOOST_SCOPE_EXIT</span><span class="special">(</span><span class="identifier">capture_list</span><span class="special">)</span> <span class="special">{</span>
- <span class="special">...</span> <span class="comment">// Body code.</span>
- <span class="special">}</span><span class="special">;</span> <span class="comment">// C++11 only.</span>
- <span class="special">...</span>
- <span class="special">}</span>
-</pre>
-<p> However, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a></code> is still provided on C++11 so to write code that is portable between C++03 and C++11 compilers.</p>
-<p><span class="bold"><strong>See:</strong></span> <a class="link" href="scope_exit/Tutorial.html" title="Tutorial">Tutorial</a> section, <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_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</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>. </p>
+<p>In general, the special macro <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_END_ID.html" title="Macro BOOST_SCOPE_EXIT_END_ID">BOOST_SCOPE_EXIT_END_ID</a></code> must be used instead of <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a></code> when it is necessary to expand multiple scope exit bodies on the same line.</p>
+<p><span class="bold"><strong>Note:</strong></span> If programmers define the <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS.html" title="Macro BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS">BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS</a></code> macro on C++11 compilers, a semicolon <code class="computeroutput">;</code> can be used instead of this macro. However, to maximize portability, it is recommended to always use <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>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="scope_exit/Tutorial.html" title="Tutorial">Tutorial</a> section, <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_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code>, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_END_ID.html" title="Macro BOOST_SCOPE_EXIT_END_ID">BOOST_SCOPE_EXIT_END_ID</a></code>. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
@@ -66,7 +58,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_SCOPE_EXIT_ALL.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.scope_exit_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_SCOPE_EXIT_ALL_ID.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.scope_exit_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT_END_ID.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Copied: branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html (from r77042, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html)
==============================================================================
--- /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html (original)
+++ branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,7 +7,7 @@
 <link rel="home" href="index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0">
 <link rel="up" href="reference.html#header.boost.scope_exit_hpp" title="Header &lt;boost/scope_exit.hpp&gt;">
 <link rel="prev" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">
-<link rel="next" href="BOOST_SCOPE_EXIT_ALL.html" title="Macro BOOST_SCOPE_EXIT_ALL">
+<link rel="next" href="BOOST_SCOPE_EXIT_ID.html" title="Macro BOOST_SCOPE_EXIT_ID">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -20,20 +20,20 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_SCOPE_EXIT.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.scope_exit_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT_ALL.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_SCOPE_EXIT.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.scope_exit_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT_ID.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="refentry">
 <a name="BOOST_SCOPE_EXIT_TPL"></a><div class="titlepage"></div>
 <div class="refnamediv">
 <h2><span class="refentrytitle">Macro BOOST_SCOPE_EXIT_TPL</span></h2>
-<p>BOOST_SCOPE_EXIT_TPL &#8212; This macro is a workaround to declare a scope exit for various versions of GCC. </p>
+<p>BOOST_SCOPE_EXIT_TPL &#8212; This macro is a workaround for various versions of GCC to declare scope exits within templates. </p>
 </div>
 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="reference.html#header.boost.scope_exit_hpp" title="Header &lt;boost/scope_exit.hpp&gt;">boost/scope_exit.hpp</a>&gt;
 
 </span>BOOST_SCOPE_EXIT_TPL(capture_list)</pre></div>
 <div class="refsect1">
-<a name="id871040"></a><h2>Description</h2>
+<a name="id815216"></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>
@@ -44,8 +44,9 @@
     <span class="special">}</span>
 </pre>
 <p>The syntax of <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> is the exact same as the one of <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>
-<p>On C++11, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> is not needed because <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> always compiles on GCC versions that support C++11 (that is also why there is no need for a <code class="computeroutput">BOOST_SCOPE_EXIT_ALL_TPL</code> macro given that <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_ALL.html" title="Macro BOOST_SCOPE_EXIT_ALL">BOOST_SCOPE_EXIT_ALL</a></code> is only available for C++11 compilers on which it always compiles correctly). However, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> is still provided on C++11 so to write code that is portable between C++03 and C++11 compilers.</p>
-<p><span class="bold"><strong>Note:</strong></span> The problem boils down to the following code (see also GCC bug 37920): </p>
+<p>On C++11 compilers, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> is not needed because <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a></code> always compiles on GCC versions that support C++11. However, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> is still provided on C++11 so to write code that is portable between C++03 and C++11 compilers. It is recommended to always use <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> within templates so to maximize portability.</p>
+<p>In general, the special macro <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL_ID.html" title="Macro BOOST_SCOPE_EXIT_TPL_ID">BOOST_SCOPE_EXIT_TPL_ID</a></code> must be used instead of <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> when it is necessary to expand multiple scope exit declarations on the same line within templates.</p>
+<p><span class="bold"><strong>Note:</strong></span> The issue in compiling scope exit declarations that some GCC versions have is illustrated by the following code (see also GCC bug 37920): </p>
 <pre class="programlisting"> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
     <span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span>
         <span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
@@ -59,9 +60,9 @@
 
     <span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">f</span><span class="special">(</span><span class="number">0</span><span class="special">)</span><span class="special">;</span> <span class="special">}</span>
 </pre>
-<p> This can be fixed by adding <code class="computeroutput">typename</code> in front of <code class="computeroutput">local::typeof_i</code> and <code class="computeroutput">local::typeof_x</code> (which is the approach followed by the implementation of <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code>).</p>
+<p> This can be fixed by adding <code class="computeroutput">typename</code> in front of <code class="computeroutput">local::typeof_i</code> and <code class="computeroutput">local::typeof_x</code> (which is the approach followed by the implementation of the <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> macro).</p>
 <p><span class="bold"><strong>Note:</strong></span> Although <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> has the same suffix as <code class="computeroutput">BOOST_TYPEOF_TPL</code>, it does not follow the Boost.Typeof convention.</p>
-<p><span class="bold"><strong>See:</strong></span> <a class="link" href="scope_exit/Tutorial.html" title="Tutorial">Tutorial</a> section, <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_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a></code>. </p>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="scope_exit/Tutorial.html" title="Tutorial">Tutorial</a> section, <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_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a></code>, <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL_ID.html" title="Macro BOOST_SCOPE_EXIT_TPL_ID">BOOST_SCOPE_EXIT_TPL_ID</a></code>. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
@@ -74,7 +75,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="BOOST_SCOPE_EXIT.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.scope_exit_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT_ALL.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="BOOST_SCOPE_EXIT.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.scope_exit_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT_ID.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Copied: branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL_ID.html (from r77930, /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL_ID.html)
==============================================================================
--- /trunk/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL_ID.html (original)
+++ branches/release/libs/scope_exit/doc/html/BOOST_SCOPE_EXIT_TPL_ID.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -33,7 +33,7 @@
 
 </span>BOOST_SCOPE_EXIT_TPL_ID(id, capture_list)</pre></div>
 <div class="refsect1">
-<a name="id858518"></a><h2>Description</h2>
+<a name="id815931"></a><h2>Description</h2>
 <p>This macro is equivalent to <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> but it can be expanded multiple times on the same line if different identifiers <code class="computeroutput">id</code> are provided for each expansion (see <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code> for more information). As with <code class="computeroutput"><a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a></code>, it is recommended to always use this macro when expanding scope exits multiple times on the same line within templates.</p>
 <p><span class="bold"><strong>Parameters:</strong></span> </p>
 <div class="informaltable"><table class="table">

Modified: branches/release/libs/scope_exit/doc/html/index.html
==============================================================================
--- branches/release/libs/scope_exit/doc/html/index.html (original)
+++ branches/release/libs/scope_exit/doc/html/index.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1,11 +1,11 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
-<title>Chapter&#160;1.&#160;Boost.ScopeExit</title>
+<title>Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0</title>
 <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
-<link rel="home" href="index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">
-<link rel="next" href="scope_exit/tutorial.html" title="Tutorial">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0">
+<link rel="next" href="scope_exit/Getting_Started.html" title="Getting Started">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -17,61 +17,113 @@
 <td align="center">More</td>
 </tr></table>
 <hr>
-<div class="spirit-nav"><a accesskey="n" href="scope_exit/tutorial.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div>
+<div class="spirit-nav"><a accesskey="n" href="scope_exit/Getting_Started.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div>
 <div class="chapter">
 <div class="titlepage"><div>
 <div><h2 class="title">
-<a name="scope_exit"></a>Chapter&#160;1.&#160;Boost.ScopeExit</h2></div>
+<a name="scope_exit"></a>Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0</h2></div>
 <div><div class="author"><h3 class="author">
 <span class="firstname">Alexander</span> <span class="surname">Nasonov</span>
 </h3></div></div>
-<div><p class="copyright">Copyright &#169; 2006 -2009 Alexander Nasonov</p></div>
+<div><div class="author"><h3 class="author">
+<span class="firstname">Lorenzo</span> <span class="surname">Caminiti <code class="email">&lt;<a class="email" href="mailto:lorcaminiti_at_[hidden]">lorcaminiti_at_[hidden]</a>&gt;</code></span>
+</h3></div></div>
+<div><p class="copyright">Copyright &#169; 2006-2012 Alexander Nasonov, Lorenzo Caminiti</p></div>
 <div><div class="legalnotice">
-<a name="id759689"></a><p>
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at &lt;ulink url="http://www.boost.org/LICENSE_1_0.txt"&gt;
- http://www.boost.org/LICENSE_1_0.txt &lt;/ulink&gt;)
+<a name="scope_exit.legal"></a><p>
+ Distributed under the Boost Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt)
       </p>
 </div></div>
 </div></div>
 <div class="toc">
 <p><b>Table of Contents</b></p>
 <dl>
-<dt><span class="section"> Introduction</span></dt>
-<dt><span class="section"> Tutorial</span></dt>
-<dt><span class="section"> Alternatives</span></dt>
-<dt><span class="section"> Supported Compilers</span></dt>
-<dt><span class="section"> Configuration</span></dt>
-<dt><span class="section"> Reference</span></dt>
-<dt><span class="section"> Acknowledge</span></dt>
+<dt><span class="section">Introduction</span></dt>
+<dt><span class="section">Getting Started</span></dt>
+<dd><dl>
+<dt><span class="section">This Documentation</span></dt>
+<dt><span class="section"><a href="scope_exit/Getting_Started.html#scope_exit.Getting_Started.compilers_and_platforms">Compilers
+ and Platforms</a></span></dt>
+<dt><span class="section">Installation</span></dt>
+</dl></dd>
+<dt><span class="section">Tutorial</span></dt>
+<dd><dl>
+<dt><span class="section">Capturing Variables</span></dt>
+<dt><span class="section"><a href="scope_exit/Tutorial.html#scope_exit.Tutorial.capturing_the_object__this_">Capturing
+ The Object <code class="computeroutput"><span class="keyword">this</span></code></a></span></dt>
+<dt><span class="section"><a href="scope_exit/Tutorial.html#scope_exit.Tutorial.capturing_no_variable">Capturing
+ No Variable</a></span></dt>
+<dt><span class="section"><a href="scope_exit/Tutorial.html#scope_exit.Tutorial.capturing_all_variables__c__11_only_">Capturing
+ All Variables (C++11 Only)</a></span></dt>
+<dt><span class="section"><a href="scope_exit/Tutorial.html#scope_exit.Tutorial.template_workaround__gcc_">Template
+ Workaround (GCC)</a></span></dt>
+<dt><span class="section">Same Line Expansions</span></dt>
+</dl></dd>
+<dt><span class="section">Annex: Alternatives</span></dt>
+<dt><span class="section">Annex: No Variadic Macros</span></dt>
+<dt><span class="section">Reference</span></dt>
+<dd><dl><dt><span class="section">Header <boost/scope_exit.hpp></span></dt></dl></dd>
+<dt><span class="section">Acknowledgements</span></dt>
 </dl>
 </div>
-<div class="section">
+<p>
+ This library allows to execute arbitrary code when the enclosing scope exits.
+ </p>
+<div class="section scope_exit_introduction">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="scope_exit.intro"></a> Introduction</h2></div></div></div>
+<a name="scope_exit.introduction"></a><a class="link" href="index.html#scope_exit.introduction" title="Introduction">Introduction</a>
+</h2></div></div></div>
 <p>
- Nowadays, every C++ developer is familiar with RAII
+ Nowadays, every C++ developer is familiar with the Resource Acquisition Is
+ Initialization (RAII)
       technique. It binds resource acquisition and release to initialization and
- destruction of a variable that holds the resource. But there are times when
- writing a special class for such variable is not worth the effort.
+ destruction of a variable that holds the resource. There are times when writing
+ a special class for such a variable is not worth the effort. This is when
+ <a class="link" href="index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0">Boost.ScopeExit</a> comes into play.
     </p>
 <p>
- This is when <a class="link" href="index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">ScopeExit</a> macro comes into play.
- You put resource acquisition directly in your code and next to it you write
- a code that releases the resource.
+ Programmers can put resource acquisition directly in their code and next to
+ it, they can write code that releases the resource using this library. For
+ example (see also world.cpp):
+ <sup>[<a name="scope_exit.introduction.f0" href="#ftn.scope_exit.introduction.f0" class="footnote">1</a>]</sup>
     </p>
 <p>
- Read <a class="link" href="scope_exit/tutorial.html" title="Tutorial">Tutorial</a> to find out how to
- write programs with <a class="link" href="index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">ScopeExit</a> or jump straight
- to the <a class="link" href="scope_exit/ref.html" title="Reference">Reference</a> section.
+</p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">world</span><span class="special">::</span><span class="identifier">add_person</span><span class="special">(</span><span class="identifier">person</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">a_person</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">bool</span> <span class="identifier">commit</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">;</span>
+
+ <span class="identifier">persons_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">a_person</span><span class="special">);</span> <span class="comment">// (1) direct action</span>
+ <span class="comment">// Following block is executed when the enclosing scope exits.</span>
+ <span class="identifier">BOOST_SCOPE_EXIT</span><span class="special">(&amp;</span><span class="identifier">commit</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">persons_</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">if</span><span class="special">(!</span><span class="identifier">commit</span><span class="special">)</span> <span class="identifier">persons_</span><span class="special">.</span><span class="identifier">pop_back</span><span class="special">();</span> <span class="comment">// (2) rollback action</span>
+ <span class="special">}</span> <span class="identifier">BOOST_SCOPE_EXIT_END</span>
+
+ <span class="comment">// ... // (3) other operations</span>
+
+ <span class="identifier">commit</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span> <span class="comment">// (4) disable rollback actions</span>
+<span class="special">}</span>
+</pre>
+<p>
     </p>
 </div>
+<div class="footnotes">
+<br><hr width="100" align="left">
+<div class="footnote"><p><sup>[<a id="ftn.scope_exit.introduction.f0" href="#scope_exit.introduction.f0" class="para">1</a>] </sup>
+ Older versions of this library used a Boost.Preprocessor
+ sequence to specify the list of captured variables. While maintaining full
+ backward compatibility, it is now possible to specify the captured variables
+ also using a comma-separated list (which is the preferred syntax). See the
+ <a class="link" href="scope_exit/No_Variadic_Macros.html" title="Annex: No Variadic Macros">No Variadic Macros</a> section
+ for more information.
+ </p></div>
+</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: July 08, 2010 at 22:36:27 GMT</small></p></td>
+<td align="left"><p><small>Last revised: April 13, 2012 at 16:49:31 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>
-<div class="spirit-nav"><a accesskey="n" href="scope_exit/tutorial.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div>
+<div class="spirit-nav"><a accesskey="n" href="scope_exit/Getting_Started.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div>
 </body>
 </html>

Copied: branches/release/libs/scope_exit/doc/html/reference.html (from r77042, /trunk/libs/scope_exit/doc/html/reference.html)
==============================================================================
--- /trunk/libs/scope_exit/doc/html/reference.html (original)
+++ branches/release/libs/scope_exit/doc/html/reference.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,7 +6,7 @@
 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 <link rel="home" href="index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0">
 <link rel="up" href="index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0">
-<link rel="prev" href="scope_exit/Tutorial.html" title="Tutorial">
+<link rel="prev" href="scope_exit/No_Variadic_Macros.html" title="Annex: No Variadic Macros">
 <link rel="next" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="scope_exit/Tutorial.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="scope_exit/No_Variadic_Macros.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="section reference">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -34,9 +34,13 @@
 
 <a class="link" href="BOOST_SCOPE_EXIT.html" title="Macro BOOST_SCOPE_EXIT">BOOST_SCOPE_EXIT</a>(capture_list)
 <a class="link" href="BOOST_SCOPE_EXIT_TPL.html" title="Macro BOOST_SCOPE_EXIT_TPL">BOOST_SCOPE_EXIT_TPL</a>(capture_list)
+<a class="link" href="BOOST_SCOPE_EXIT_ID.html" title="Macro BOOST_SCOPE_EXIT_ID">BOOST_SCOPE_EXIT_ID</a>(id, capture_list)
+<a class="link" href="BOOST_SCOPE_EXIT_TPL_ID.html" title="Macro BOOST_SCOPE_EXIT_TPL_ID">BOOST_SCOPE_EXIT_TPL_ID</a>(id, capture_list)
 <a class="link" href="BOOST_SCOPE_EXIT_ALL.html" title="Macro BOOST_SCOPE_EXIT_ALL">BOOST_SCOPE_EXIT_ALL</a>(capture_list)
+<a class="link" href="BOOST_SCOPE_EXIT_ALL_ID.html" title="Macro BOOST_SCOPE_EXIT_ALL_ID">BOOST_SCOPE_EXIT_ALL_ID</a>(id, capture_list)
 <a class="link" href="BOOST_SCOPE_EXIT_END.html" title="Macro BOOST_SCOPE_EXIT_END">BOOST_SCOPE_EXIT_END</a>
-<a class="link" href="BOOST_SCOPE_EXIT_CONFIG_NO_CPP11.html" title="Macro BOOST_SCOPE_EXIT_CONFIG_NO_CPP11">BOOST_SCOPE_EXIT_CONFIG_NO_CPP11</a></pre>
+<a class="link" href="BOOST_SCOPE_EXIT_END_ID.html" title="Macro BOOST_SCOPE_EXIT_END_ID">BOOST_SCOPE_EXIT_END_ID</a>(id)
+<a class="link" href="BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS.html" title="Macro BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS">BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS</a></pre>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
@@ -49,7 +53,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="scope_exit/Tutorial.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="scope_exit/No_Variadic_Macros.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="BOOST_SCOPE_EXIT.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Copied: branches/release/libs/scope_exit/doc/html/scope_exit/Acknowledgements.html (from r77042, /trunk/libs/scope_exit/doc/html/scope_exit/Acknowledgements.html)
==============================================================================
--- /trunk/libs/scope_exit/doc/html/scope_exit/Acknowledgements.html (original)
+++ branches/release/libs/scope_exit/doc/html/scope_exit/Acknowledgements.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,7 +6,7 @@
 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 <link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0">
 <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0">
-<link rel="prev" href="No_Variadic_Macros.html" title="Annex: No Variadic Macros">
+<link rel="prev" href="../BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS.html" title="Macro BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -19,7 +19,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="No_Variadic_Macros.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a>
+<a accesskey="p" href="../BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a>
 </div>
 <div class="section scope_exit_Acknowledgements">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -32,28 +32,28 @@
       Lorenzo Caminiti added variadic macro support, capture of the object <code class="computeroutput"><span class="identifier">this_</span></code>, empty captures using <code class="computeroutput"><span class="keyword">void</span></code>, and <code class="computeroutput"><span class="identifier">BOOST_SCOPE_EXIT_ALL</span></code>.
     </p>
 <p>
- <span class="emphasis"><em>Thanks to the following people (in chronological order).</em></span>
+ Thanks to the following people (in chronological order):
     </p>
 <p>
       Maxim Yegorushkin for sharing code where he used a local struct to clean up
- resources.
+ resources;
     </p>
 <p>
       Andrei Alexandrescu for pointing out the scope(exit)
       construct of the D
- programming language.
+ programming language;
     </p>
 <p>
- Pavel Vozenilek and Maxim Yanchenko for reviews of early drafts of the library.
+ Pavel Vozenilek and Maxim Yanchenko for reviews of early drafts of the library;
     </p>
 <p>
- Steven Watanabe for his valuable ideas.
+ Steven Watanabe for his valuable ideas;
     </p>
 <p>
- Jody Hagins for good comments that helped to significantly improve the documentation.
+ Jody Hagins for good comments that helped to significantly improve the documentation;
     </p>
 <p>
- Richard Webb for testing the library on MSVC compiler.
+ Richard Webb for testing the library on MSVC compiler;
     </p>
 <p>
       Adam Butcher for a workaround to error C2355 when deducing the type of <code class="computeroutput"><span class="keyword">this</span></code> on some MSVC versions.
@@ -69,7 +69,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="No_Variadic_Macros.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a>
+<a accesskey="p" href="../BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a>
 </div>
 </body>
 </html>

Copied: branches/release/libs/scope_exit/doc/html/scope_exit/Getting_Started.html (from r77042, /trunk/libs/scope_exit/doc/html/scope_exit/Getting_Started.html)
==============================================================================
--- /trunk/libs/scope_exit/doc/html/scope_exit/Getting_Started.html (original)
+++ branches/release/libs/scope_exit/doc/html/scope_exit/Getting_Started.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -27,6 +27,7 @@
 <a name="scope_exit.Getting_Started"></a><a class="link" href="Getting_Started.html" title="Getting Started">Getting Started</a>
 </h2></div></div></div>
 <div class="toc"><dl>
+<dt><span class="section">This Documentation</span></dt>
 <dt><span class="section"><a href="Getting_Started.html#scope_exit.Getting_Started.compilers_and_platforms">Compilers
       and Platforms</a></span></dt>
 <dt><span class="section">Installation</span></dt>
@@ -34,34 +35,61 @@
 <p>
       This section explains how to setup a system to use this library.
     </p>
+<div class="section scope_exit_Getting_Started_this_documentation">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="scope_exit.Getting_Started.this_documentation"></a><a class="link" href="Getting_Started.html#scope_exit.Getting_Started.this_documentation" title="This Documentation">This Documentation</a>
+</h3></div></div></div>
+<p>
+ Programmers should have enough knowledge to use this library after reading
+ the <a class="link" href="../">Introduction</a>, <a class="link" href="Getting_Started.html" title="Getting Started">Getting
+ Started</a>, and <a class="link" href="Tutorial.html" title="Tutorial">Tutorial</a> sections.
+ The Reference section can be consulted
+ at a later point for quick reference. All the other sections of this documentation
+ can be considered optional.
+ </p>
+<p>
+ Some footnotes are marked by the word "<span class="bold"><strong>Rationale</strong></span>".
+ They explain reasons behind decisions made during the design and implementation
+ of this library.
+ </p>
+<p>
+ In most of the examples presented in this documentation, the Boost.Detail/LightweightTest
+ (<code class="literal">boost/detail/lightweight_test.hpp</code>) macro <code class="computeroutput"><span class="identifier">BOOST_TEST</span></code> is used to check correctness
+ conditions. The <code class="computeroutput"><span class="identifier">BOOST_TEST</span></code>
+ macro is conceptually similar to <code class="computeroutput"><span class="identifier">assert</span></code>
+ but a failure of the checked condition does not abort the program, instead
+ it makes <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">report_errors</span></code> return a non-zero program
+ exit code. <sup>[<a name="scope_exit.Getting_Started.this_documentation.f0" href="#ftn.scope_exit.Getting_Started.this_documentation.f0" class="footnote">2</a>]</sup>
+ </p>
+</div>
 <div class="section scope_exit_Getting_Started_compilers_and_platforms">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="scope_exit.Getting_Started.compilers_and_platforms"></a><a class="link" href="Getting_Started.html#scope_exit.Getting_Started.compilers_and_platforms" title="Compilers and Platforms">Compilers
       and Platforms</a>
 </h3></div></div></div>
 <p>
- The library should be usable on any compiler that supports Boost.Typeof
- except:
+ The authors originally developed and tested the library on GNU Compiler Collection
+ (GCC) C++ 3.3, 3.4, 4.1, 4.2, 4.5.3 (with and without C++11 features <code class="literal">-std=c++0x</code>),
+ Microsoft Visual C++ (MSVC) 8.0, and Intel 10.1 under Linux, Cygwin, and
+ Windows 7. However, this library should be usable on any compiler that supports
+ Boost.Typeof except:
       </p>
 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
 <li class="listitem">
             MSVC 7.1 and 8.0 fail to link if a function with <a class="link" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0">Boost.ScopeExit</a>
- is included by multiple translation units. Furthermore, on MSVC 7.1 and
- 8.0 it is possible to capture the object <code class="computeroutput"><span class="identifier">this_</span></code>
- only with native Boost.Typeof
- (and not in type-of emulation
- mode).
+ is included by multiple translation units.
           </li>
 <li class="listitem">
             GCC 3.3 cannot compile <a class="link" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0">Boost.ScopeExit</a>
             inside a template (see http://lists.boost.org/Archives/boost/2007/02/116235.php
- for more details).
+ for details).
           </li>
 </ul></div>
 <p>
- The authors tested the library on GCC 3.3, 3.4, 4.1, 4.2, 4.5.3 (with and
- without C++11 features <code class="literal">-std=c++0x</code>), MSVC 8.0, and Intel
- 10.1 under Linux, Cygwin, and Windows 7.
+ See the library <a href="http://www.boost.org/development/tests/release/developer/scope_exit.html" target="_top">regression
+ test results</a> for detailed information on supported compilers and
+ platforms. Check the library regression test Jamfile.v2
+ for any special configuration that might be required for a specific compiler.
       </p>
 </div>
 <div class="section scope_exit_Getting_Started_installation">
@@ -79,12 +107,20 @@
         to automatically deduce the types of the <a class="link" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0">Boost.ScopeExit</a>
         captured variables (see the <a class="link" href="Tutorial.html" title="Tutorial">Tutorial</a>
         section). In order to compile code in <a href="http://www.boost.org/libs/typeof" target="_top">type-of
- emulation</a> mode, all types should be properly registered with BOOST_TYPEOF_REGISTER_TYPE
- or BOOST_TYPEOF_REGISTER_TEMPLATE
- macros, or appropriate Boost.Typeof
- headers should be included.
+ emulation</a> mode, all types should be properly registered using <code class="computeroutput"><span class="identifier">BOOST_TYPEOF_REGISTER_TYPE</span></code> and <code class="computeroutput"><span class="identifier">BOOST_TYPEOF_REGISTER_TEMPLATE</span></code>, or appropriate
+ Boost.Typeof headers
+ should be included (see the source code of most examples presented in this
+ documentation).
       </p>
 </div>
+<div class="footnotes">
+<br><hr width="100" align="left">
+<div class="footnote"><p><sup>[<a id="ftn.scope_exit.Getting_Started.this_documentation.f0" href="#scope_exit.Getting_Started.this_documentation.f0" class="para">2</a>] </sup>
+ <span class="bold"><strong>Rationale.</strong></span> Using Boost.Detail/LightweightTest
+ allows to add the examples to the library regression tests so to make sure
+ that they always compile and run correctly.
+ </p></div>
+</div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
 <td align="left"></td>

Copied: branches/release/libs/scope_exit/doc/html/scope_exit/No_Variadic_Macros.html (from r77042, /trunk/libs/scope_exit/doc/html/scope_exit/No_Variadic_Macros.html)
==============================================================================
--- /trunk/libs/scope_exit/doc/html/scope_exit/No_Variadic_Macros.html (original)
+++ branches/release/libs/scope_exit/doc/html/scope_exit/No_Variadic_Macros.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,7 +7,7 @@
 <link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0">
 <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit 1.1.0">
 <link rel="prev" href="Alternatives.html" title="Annex: Alternatives">
-<link rel="next" href="Acknowledgements.html" title="Acknowledgements">
+<link rel="next" href="../reference.html" title="Reference">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="Alternatives.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Acknowledgements.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="Alternatives.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../reference.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="section scope_exit_No_Variadic_Macros">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -37,9 +37,9 @@
     </h6>
 <p>
       Most modern compilers support variadic macros (notably, these include GCC,
- MSVC, and all C++11 compilers). However, in the rare case that programmers
- need to use this library on a complier without variaidc macros, this library
- also allows to specify the capture list using a Boost.Preprocessor
+ MSVC, and all C++11 compilers). <sup>[<a name="scope_exit.No_Variadic_Macros.f0" href="#ftn.scope_exit.No_Variadic_Macros.f0" class="footnote">10</a>]</sup> However, in the rare case that programmers need to use this library
+ on a complier without variaidc macros, this library also allows to specify
+ the capture list using a Boost.Preprocessor
       sequence where tokens are separated by round parenthesis <code class="computeroutput"><span class="special">()</span></code>:
     </p>
 <pre class="programlisting"><span class="special">(</span><span class="identifier">capture1</span><span class="special">)</span> <span class="special">(</span><span class="identifier">capture2</span><span class="special">)</span> <span class="special">...</span> <span class="comment">// All compilers.</span>
@@ -52,11 +52,31 @@
 </pre>
 <p>
       For example, the following syntax is accepted on all compilers with and without
- variadic macros (see also world_seq.cpp):
+ variadic macros (see also world_seq.cpp
+ and world.cpp):
     </p>
-<p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Boost.Preprocessor Sequence (All Compilers)
+ </p>
+ </th>
+<th>
+ <p>
+ Comma-Separated List (Variadic Macros Only)
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
 </p>
-<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">world</span><span class="special">::</span><span class="identifier">add_person</span><span class="special">(</span><span class="identifier">person</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">a_person</span><span class="special">)</span> <span class="special">{</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">void</span> <span class="identifier">world</span><span class="special">::</span><span class="identifier">add_person</span><span class="special">(</span><span class="identifier">person</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">a_person</span><span class="special">)</span> <span class="special">{</span>
     <span class="keyword">bool</span> <span class="identifier">commit</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">;</span>
 
     <span class="identifier">persons_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">a_person</span><span class="special">);</span>
@@ -70,17 +90,12 @@
 <span class="special">}</span>
 </pre>
 <p>
- </p>
-<p>
- Furthermore, older versions of this library used to only support the Boost.Preprocessor sequence
- syntax so the above syntax is also supported for backward compatibility. However,
- in the current version of this library and on compilers with variadic macros,
- the comma-separated syntax we have seen so far is preferred because more readable
- (see also world.cpp):
- </p>
-<p>
+ </p>
+ </td>
+<td>
+ <p>
 </p>
-<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">world</span><span class="special">::</span><span class="identifier">add_person</span><span class="special">(</span><span class="identifier">person</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">a_person</span><span class="special">)</span> <span class="special">{</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">void</span> <span class="identifier">world</span><span class="special">::</span><span class="identifier">add_person</span><span class="special">(</span><span class="identifier">person</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">a_person</span><span class="special">)</span> <span class="special">{</span>
     <span class="keyword">bool</span> <span class="identifier">commit</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">;</span>
 
     <span class="identifier">persons_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">a_person</span><span class="special">);</span> <span class="comment">// (1) direct action</span>
@@ -95,12 +110,21 @@
 <span class="special">}</span>
 </pre>
 <p>
- </p>
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
 <p>
       Note how the same macros accept both syntaxes on compilers with variadic macros
       and only the Boost.Preprocessor
- sequence syntax on compilers without variadic macros. Finally, an empty capture
- list is always specified using <code class="computeroutput"><span class="keyword">void</span></code>
+ sequence syntax on compilers without variadic macros. Older versions of this
+ library used to only support the Boost.Preprocessor
+ sequence syntax so this syntax is supported also for backward compatibility.
+ However, in the current version of this library and on compilers with variadic
+ macros, the comma-separated syntax is preferred because it is more readable.
+ </p>
+<p>
+ Finally, an empty capture list is always specified using <code class="computeroutput"><span class="keyword">void</span></code>
       on compilers with and without variaidc macros (see also world_void.cpp):
     </p>
 <p>
@@ -130,9 +154,9 @@
       <span><a name="scope_exit.No_Variadic_Macros.examples"></a></span><a class="link" href="No_Variadic_Macros.html#scope_exit.No_Variadic_Macros.examples">Examples</a>
     </h6>
 <p>
- The following is a list of most of the examples presented in this documentation
- reprogrammed using the Boost.Preprocessor
- sequence syntax instead of the comma-separated list:
+ For reference, the following is a list of most of the examples presented in
+ this documentation reprogrammed using the Boost.Preprocessor
+ sequence syntax instead of comma-separated lists (in alphabetic order):
     </p>
 <div class="informaltable"><table class="table">
 <colgroup><col></colgroup>
@@ -144,12 +168,17 @@
 <tbody>
 <tr><td>
               <p>
- world_checkpoint_seq.cpp
+ same_line_seq.cpp
               </p>
             </td></tr>
 <tr><td>
               <p>
- world_this_seq.cpp
+ scope_guard_seq.cpp
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ try_catch_seq.cpp
               </p>
             </td></tr>
 <tr><td>
@@ -159,21 +188,29 @@
             </td></tr>
 <tr><td>
               <p>
- world_tpl_seq.cpp
+ world_checkpoint_seq.cpp
               </p>
             </td></tr>
 <tr><td>
               <p>
- try_catch_seq.cpp
+ world_this_seq.cpp
               </p>
             </td></tr>
 <tr><td>
               <p>
- scope_guard_seq.cpp
+ world_tpl_seq.cpp
               </p>
             </td></tr>
 </tbody>
 </table></div>
+<div class="footnotes">
+<br><hr width="100" align="left">
+<div class="footnote"><p><sup>[<a id="ftn.scope_exit.No_Variadic_Macros.f0" href="#scope_exit.No_Variadic_Macros.f0" class="para">10</a>] </sup>
+ A C++ compiler does not support variadic macros if the Boost.Config
+ macro <code class="computeroutput"><span class="identifier">BOOST_NO_VARIADIC_MACROS</span></code>
+ is defined for that compiler.
+ </p></div>
+</div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
 <td align="left"></td>
@@ -185,7 +222,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="Alternatives.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Acknowledgements.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="Alternatives.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../reference.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Deleted: branches/release/libs/scope_exit/doc/html/scope_exit/acknowledge.html
==============================================================================
--- branches/release/libs/scope_exit/doc/html/scope_exit/acknowledge.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,66 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
-<title>Acknowledge</title>
-<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
-<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">
-<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">
-<link rel="prev" href="ref.html" title="Reference">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>
-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
-<td align="center">Home</td>
-<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
-<td align="center">More</td>
-</tr></table>
-<hr>
-<div class="spirit-nav">
-<a accesskey="p" href="ref.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a>
-</div>
-<div class="section">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="scope_exit.acknowledge"></a> Acknowledge</h2></div></div></div>
-<p>
- (in chronological order)
- </p>
-<p>
- Maxim Yegorushkin for sending me a code where he used a local struct to clean
- up resources.
- </p>
-<p>
- Andrei Alexandrescu for pointing me to scope(exit)
- construct of the D
- programming language.
- </p>
-<p>
- Pavel Vozenilek and Maxim Yanchenko for reviews of early drafts of the library.
- </p>
-<p>
- Steven Watanabe for his valuable ideas.
- </p>
-<p>
- Jody Hagins for good comments that helped to significantly improve the documentation.
- </p>
-<p>
- Richard Webb for testing the library on MSVC compiler.
- </p>
-</div>
-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"></td>
-<td align="right"><div class="copyright-footer">Copyright &#169; 2006 -2009 Alexander Nasonov<p>
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at &lt;ulink url="http://www.boost.org/LICENSE_1_0.txt"&gt;
- http://www.boost.org/LICENSE_1_0.txt &lt;/ulink&gt;)
- </p>
-</div></td>
-</tr></table>
-<hr>
-<div class="spirit-nav">
-<a accesskey="p" href="ref.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a>
-</div>
-</body>
-</html>

Copied: branches/release/libs/scope_exit/doc/html/scope_exit/alternatives.html (from r77042, /trunk/libs/scope_exit/doc/html/scope_exit/alternatives.html)
==============================================================================
--- /trunk/libs/scope_exit/doc/html/scope_exit/alternatives.html (original)
+++ branches/release/libs/scope_exit/doc/html/scope_exit/alternatives.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -286,7 +286,7 @@
     <span class="keyword">bool</span> <span class="identifier">commit</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">;</span>
 
     <span class="identifier">persons_</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">a_person</span><span class="special">);</span>
- <span class="identifier">scope_exit</span> <span class="identifier">on_exit1</span><span class="special">([&amp;</span><span class="identifier">commit</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">persons_</span><span class="special">]()</span> <span class="special">{</span> <span class="comment">// Use C++11 lambda.</span>
+ <span class="identifier">scope_exit</span> <span class="identifier">on_exit1</span><span class="special">([&amp;</span><span class="identifier">commit</span><span class="special">,</span> <span class="special">&amp;</span><span class="identifier">persons_</span><span class="special">](</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Use C++11 lambda.</span>
         <span class="keyword">if</span><span class="special">(!</span><span class="identifier">commit</span><span class="special">)</span> <span class="identifier">persons_</span><span class="special">.</span><span class="identifier">pop_back</span><span class="special">();</span>
     <span class="special">});</span>
 

Deleted: branches/release/libs/scope_exit/doc/html/scope_exit/compilers.html
==============================================================================
--- branches/release/libs/scope_exit/doc/html/scope_exit/compilers.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,61 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
-<title>Supported Compilers</title>
-<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
-<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">
-<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">
-<link rel="prev" href="alternatives.html" title="Alternatives">
-<link rel="next" href="conf.html" title="Configuration">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>
-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
-<td align="center">Home</td>
-<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
-<td align="center">More</td>
-</tr></table>
-<hr>
-<div class="spirit-nav">
-<a accesskey="p" href="alternatives.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="conf.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
-</div>
-<div class="section">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="scope_exit.compilers"></a> Supported Compilers</h2></div></div></div>
-<p>
- The library should be usable on any compiler that supports Boost.Typeof
- except
- </p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
-<li class="listitem">
- MSVC 7.1 and 8.0 fail to link if a function with <a class="link" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">ScopeExit</a>
- is included by multiple translation units.
- </li>
-<li class="listitem">
- GCC 3.3 can't compile <a class="link" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">ScopeExit</a> inside
- a template. See <a href="http://lists.boost.org/Archives/boost/2007/02/116235.php" target="_top">this
- thread</a> for more details.
- </li>
-</ul></div>
-<p>
- The author tested the library on GCC 3.3, 3.4, 4.1, 4.2 and Intel 10.1.
- </p>
-</div>
-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"></td>
-<td align="right"><div class="copyright-footer">Copyright &#169; 2006 -2009 Alexander Nasonov<p>
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at &lt;ulink url="http://www.boost.org/LICENSE_1_0.txt"&gt;
- http://www.boost.org/LICENSE_1_0.txt &lt;/ulink&gt;)
- </p>
-</div></td>
-</tr></table>
-<hr>
-<div class="spirit-nav">
-<a accesskey="p" href="alternatives.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="conf.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
-</div>
-</body>
-</html>

Deleted: branches/release/libs/scope_exit/doc/html/scope_exit/conf.html
==============================================================================
--- branches/release/libs/scope_exit/doc/html/scope_exit/conf.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,49 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
-<title>Configuration</title>
-<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
-<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">
-<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">
-<link rel="prev" href="compilers.html" title="Supported Compilers">
-<link rel="next" href="ref.html" title="Reference">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>
-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
-<td align="center">Home</td>
-<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
-<td align="center">More</td>
-</tr></table>
-<hr>
-<div class="spirit-nav">
-<a accesskey="p" href="compilers.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="ref.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
-</div>
-<div class="section">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="scope_exit.conf"></a> Configuration</h2></div></div></div>
-<p>
- Normally, no configuration is required for the library but note that the library
- depends on Boost.Typeof
- and you may want to configure or enforce <a href="../../../../../libs/typeof/index.html" target="_top">typeof
- emulation</a>.
- </p>
-</div>
-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"></td>
-<td align="right"><div class="copyright-footer">Copyright &#169; 2006 -2009 Alexander Nasonov<p>
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at &lt;ulink url="http://www.boost.org/LICENSE_1_0.txt"&gt;
- http://www.boost.org/LICENSE_1_0.txt &lt;/ulink&gt;)
- </p>
-</div></td>
-</tr></table>
-<hr>
-<div class="spirit-nav">
-<a accesskey="p" href="compilers.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="ref.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
-</div>
-</body>
-</html>

Deleted: branches/release/libs/scope_exit/doc/html/scope_exit/ref.html
==============================================================================
--- branches/release/libs/scope_exit/doc/html/scope_exit/ref.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,153 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
-<title>Reference</title>
-<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
-<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">
-<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">
-<link rel="prev" href="conf.html" title="Configuration">
-<link rel="next" href="acknowledge.html" title="Acknowledge">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>
-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
-<td align="center">Home</td>
-<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
-<td align="center">More</td>
-</tr></table>
-<hr>
-<div class="spirit-nav">
-<a accesskey="p" href="conf.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="acknowledge.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
-</div>
-<div class="section">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="scope_exit.ref"></a> Reference</h2></div></div></div>
-<a name="ref.boost_scope_exit"></a><h4>
-<a name="id763687"></a>
- BOOST_SCOPE_EXIT
- </h4>
-<p>
- A <a class="link" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">ScopeExit</a> declaration has the following
- synopsis:
- </p>
-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">scope_exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
-
-<span class="identifier">BOOST_SCOPE_EXIT</span> <span class="special">(</span> <span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span> <span class="special">)</span>
- <span class="identifier">function</span><span class="special">-</span><span class="identifier">body</span>
-<span class="identifier">BOOST_SCOPE_EXIT_END</span>
-</pre>
-<p>
- where
- </p>
-<pre class="programlisting"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span><span class="special">:</span>
- <span class="special">(</span> <span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span> <span class="special">)</span>
- <span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span> <span class="special">(</span> <span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span> <span class="special">)</span>
-
-<span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">:</span>
- <span class="identifier">identifier</span>
- <span class="special">&amp;</span><span class="identifier">identifier</span>
-</pre>
-<p>
- The <a class="link" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">ScopeExit</a> declaration schedules an execution
- of <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code>
- at the end of the current scope. The <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code> statements are executed in the reverse
- order of <a class="link" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">ScopeExit</a> declarations in the given
- scope. The scope must be local.
- </p>
-<p>
- Each <code class="computeroutput"><span class="identifier">identifier</span></code> in <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span></code> must
- be a valid name in enclosing scope and it must appear exactly once in the list.
- If a <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span></code>
- starts with the ampersand sign <code class="computeroutput"><span class="special">&amp;</span></code>,
- the corresponding <code class="computeroutput"><span class="identifier">identifier</span></code>
- will be available inside <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code>; otherwise, a copy of it will be made
- at the point of <a class="link" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">ScopeExit</a> declaration and
- that copy will be available inside <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code>. In the latter case, the <code class="computeroutput"><span class="identifier">idenitifer</span></code> must be <code class="computeroutput"><span class="identifier">CopyConstructible</span></code>.
- </p>
-<p>
- Only identifiers listed in <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span></code>, static variables, <code class="computeroutput"><span class="keyword">extern</span></code>
- variables and functions, and enumerations from the enclosing scope can be used
- inside the <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">body</span></code>.
- </p>
-<div class="note"><table border="0" summary="Note">
-<tr>
-<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../doc/src/images/note.png"></td>
-<th align="left">Note</th>
-</tr>
-<tr><td align="left" valign="top"><p>
- <code class="computeroutput"><span class="keyword">this</span></code> pointer is not an identifier
- and cannot be passed to <code class="computeroutput"> <span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span></code>.
- </p></td></tr>
-</table></div>
-<p>
- The <a class="link" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">ScopeExit</a> uses Boost.Typeof
- to determine types of <code class="computeroutput"><span class="identifier">scope</span><span class="special">-</span><span class="identifier">exit</span><span class="special">-</span><span class="identifier">capture</span><span class="special">-</span><span class="identifier">list</span></code> elements. In order to compile code in
- typeof emulation mode,
- all types should be registered with BOOST_TYPEOF_REGISTER_TYPE
- or BOOST_TYPEOF_REGISTER_TEMPLATE
- macros, or appropriate Boost.Typeof
- headers should be included.
- </p>
-<a name="ref.boost_scope_exit_tpl"></a><h4>
-<a name="id764391"></a>
- BOOST_SCOPE_EXIT_TPL
- </h4>
-<p>
- This macro is a workaround for various versions of gcc. These compilers don't
- compile <a class="link" href="../index.html" title="Chapter&#160;1.&#160;Boost.ScopeExit">ScopeExit</a> declaration inside function
- templates. As a workaround, the <code class="computeroutput"><span class="identifier">_TPL</span></code>
- suffix should be appended to <code class="computeroutput"><span class="identifier">BOOST_SCOPE_EXIT</span></code>.
- </p>
-<p>
- The problem boils down to the following code:
- </p>
-<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">void</span> <span class="identifier">foo</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">t</span><span class="special">)</span> <span class="special">{</span>
- <span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
- <span class="keyword">struct</span> <span class="identifier">Local</span> <span class="special">{</span>
- <span class="keyword">typedef</span> <span class="identifier">__typeof__</span><span class="special">(</span><span class="identifier">i</span><span class="special">)</span> <span class="identifier">typeof_i</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">__typeof__</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span> <span class="identifier">typeof_t</span><span class="special">;</span>
- <span class="special">};</span>
- <span class="keyword">typedef</span> <span class="identifier">Local</span><span class="special">::</span><span class="identifier">typeof_i</span> <span class="identifier">i_type</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">Local</span><span class="special">::</span><span class="identifier">typeof_t</span> <span class="identifier">t_type</span><span class="special">;</span>
-<span class="special">}</span>
-
-<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span> <span class="identifier">foo</span><span class="special">(</span><span class="number">0</span><span class="special">);</span> <span class="special">}</span>
-</pre>
-<p>
- This can be fixed by adding <code class="computeroutput"><span class="keyword">typename</span></code>
- in front of <code class="computeroutput"><span class="identifier">Local</span><span class="special">::</span><span class="identifier">typeof_i</span></code> and <code class="computeroutput"><span class="identifier">Local</span><span class="special">::</span><span class="identifier">typeof_t</span></code>.
- </p>
-<p>
- See also <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37920" target="_top">GCC
- bug 37920</a>.
- </p>
-<div class="note"><table border="0" summary="Note">
-<tr>
-<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../doc/src/images/note.png"></td>
-<th align="left">Note</th>
-</tr>
-<tr><td align="left" valign="top"><p>
- Although <code class="computeroutput"><span class="identifier">BOOST_SCOPE_EXIT_TPL</span></code>
- has the same suffix as the <code class="computeroutput"><span class="identifier">BOOST_TYPEOF_TPL</span></code>,
- it doesn't follow a convention of the Boost.Typeof.
- </p></td></tr>
-</table></div>
-</div>
-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"></td>
-<td align="right"><div class="copyright-footer">Copyright &#169; 2006 -2009 Alexander Nasonov<p>
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at &lt;ulink url="http://www.boost.org/LICENSE_1_0.txt"&gt;
- http://www.boost.org/LICENSE_1_0.txt &lt;/ulink&gt;)
- </p>
-</div></td>
-</tr></table>
-<hr>
-<div class="spirit-nav">
-<a accesskey="p" href="conf.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="acknowledge.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
-</div>
-</body>
-</html>

Modified: branches/release/libs/scope_exit/doc/scope_exit.qbk
==============================================================================
--- branches/release/libs/scope_exit/doc/scope_exit.qbk (original)
+++ branches/release/libs/scope_exit/doc/scope_exit.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1,480 +1,500 @@
+
+[/ Copyright (C) 2006-2009, 2012 Alexander Nasonov ]
+[/ Copyright (C) 2012 Lorenzo Caminiti ]
+[/ Distributed under the Boost Software License, Version 1.0 ]
+[/ (see accompanying file LICENSE_1_0.txt or a copy at ]
+[/ http://www.boost.org/LICENSE_1_0.txt) ]
+[/ Home at http://www.boost.org/libs/scope_exit ]
+
 [library Boost.ScopeExit
- [copyright 2006-2009 Alexander Nasonov]
+ [quickbook 1.5]
+ [version 1.1.0]
+ [copyright 2006-2012 Alexander Nasonov, Lorenzo Caminiti]
     [purpose execute arbitrary code at scope exit]
     [license
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENSE_1_0.txt or copy at
- <ulink url="http://www.boost.org/LICENSE_1_0.txt">
- http://www.boost.org/LICENSE_1_0.txt
- </ulink>)
+ Distributed under the Boost Software License, Version 1.0
+ (see accompanying file LICENSE_1_0.txt or a copy at
+ [@http://www.boost.org/LICENSE_1_0.txt])
+ ]
+ [authors
+ [Nasonov, Alexander]
+ [Caminiti <email>lorcaminiti_at_[hidden]</email>, Lorenzo]
     ]
- [authors [Nasonov, Alexander]]
     [category utility]
     [id scope_exit]
     [dirname scope_exit]
 ]
 
-[/ Images ]
+[def __Introduction__ [link scope_exit.introduction Introduction]]
+[def __Getting_Started__ [link scope_exit.getting_started Getting Started]]
+[def __Tutorial__ [link scope_exit.tutorial Tutorial]]
+[def __No_Variadic_Macros__ [link scope_exit.no_variadic_macros No Variadic Macros]]
+[def __Reference__ [@reference.html Reference]]
+[def __Boost_ScopeExit__ [link scope_exit Boost.ScopeExit]]
+[def __Boost_Lambda__ [@http://www.boost.org/libs/lambda Boost.Lambda]]
+[def __Boost_Phoenix__ [@http://www.boost.org/libs/phoenix Boost.Phoenix]]
+[def __Boost_Typeof__ [@http://www.boost.org/libs/typeof Boost.Typeof]]
+[def __typeof_emulation__ [@http://www.boost.org/libs/typeof type-of emulation]]
+[def __Boost_Preprocessor__ [@http://www.boost.org/libs/preprocessor Boost.Preprocessor]]
+[def __Boost_Config__ [@http://www.boost.org/libs/config Boost.Config]]
+[def __Boost_PointerContainer__ [@http://www.boost.org/libs/ptr_container Boost.PointerContainer]]
+[def __Boost_Multi_Index__ [@http://www.boost.org/libs/multi_index Boost.Multi-Index]]
+[def __ScopeGuard__ [@http://www.ddj.com/dept/cpp/184403758 ScopeGuard]]
+[def __D__ [@http://www.digitalmars.com/d/index.html D]]
+[def __D_scope_exit__ [@http://www.digitalmars.com/d/2.0/statement.html#ScopeGuardStatement scope(exit)]]
+[def __RAII__ [@http://www.research.att.com/~bs/glossary.html#Gresource-acquisition-is-initialization RAII]]
+[def __strong_guarantee__ [@http://www.research.att.com/~bs/glossary.html#Gstrong-guarantee strong guarantee]]
+
+[import ../test/world.cpp]
+[import ../test/world_seq.cpp]
+[import ../test/world_checkpoint.cpp]
+[import ../test/world_this.cpp]
+[import ../test/world_void.cpp]
+[import ../test/world_checkpoint_all.cpp]
+[import ../test/world_tpl.cpp]
+[import ../test/same_line.cpp]
+[import ../example/try_catch.cpp]
+[import ../example/scope_guard.cpp]
+[import ../example/world_cxx11_lambda.cpp]
+
+This library allows to execute arbitrary code when the enclosing scope exits.
+
+[section Introduction]
+
+Nowadays, every C++ developer is familiar with the Resource Acquisition Is Initialization (__RAII__) technique.
+It binds resource acquisition and release to initialization and destruction of a variable that holds the resource.
+There are times when writing a special class for such a variable is not worth the effort.
+This is when __Boost_ScopeExit__ comes into play.
+
+Programmers can put resource acquisition directly in their code and next to it, they can write code that releases the resource using this library.
+For example (see also [@../../test/world.cpp =world.cpp=]):
+[footnote
+Older versions of this library used a __Boost_Preprocessor__ sequence to specify the list of captured variables.
+While maintaining full backward compatibility, it is now possible to specify the captured variables also using a comma-separated list (which is the preferred syntax).
+See the __No_Variadic_Macros__ section for more information.
+]
 
-[def _note_ [$images/note.png]]
+[world]
 
-[/ Links ]
+[endsect]
 
-[def _scope_exit_ [link scope_exit ScopeExit]]
-[def _Tutorial_ [link scope_exit.tutorial Tutorial]]
-[def _Reference_ [link scope_exit.ref Reference]]
-[def _lambda_ [@../../../../libs/lambda/index.html Boost.Lambda]]
-[def _typeof_ [@../../../../libs/typeof/index.html Boost.Typeof]]
-[def _typeof_emulation_ [@../../../../libs/typeof/index.html typeof emulation]]
-[def _typeof_REGISTER_TYPE_ [@../../../../doc/html/typeof/refe.html#typeof.regtype BOOST_TYPEOF_REGISTER_TYPE]]
-[def _typeof_REGISTER_TEMPLATE_ [@../../../../doc/html/typeof/refe.html#typeof.regtemp BOOST_TYPEOF_REGISTER_TEMPLATE]]
-[def _pp_ [@../../../../libs/preprocessor/index.html Boost.Preprocessor]]
-[def _pp_seq_ [@../../../../libs/preprocessor/index.html Boost.Preprocessor sequence]]
-[def _ptr_container_ [@../../../../libs/ptr_container/doc/ptr_container.html Boost Pointer Container Library]]
-[def _multi_index_ [@../../../../libs/multi_index/doc/index.html Boost Multi-Index Containers Library]]
-[def _scope_guard_ [@http://www.ddj.com/dept/cpp/184403758 ScopeGuard]]
-[def _D_ [@http://www.digitalmars.com/d/index.html D]]
-[def _D_scope_exit_ [@http://www.digitalmars.com/d/2.0/statement.html#ScopeGuardStatement scope(exit)]]
-[def _RAII_ [@http://www.research.att.com/~bs/glossary.html#Gresource-acquisition-is-initialization RAII]]
-[def _strong_guarantee_ [@http://www.research.att.com/~bs/glossary.html#Gstrong-guarantee strong guarantee]]
-
-[section:intro Introduction]
-
-Nowadays, every C++ developer is familiar with _RAII_ technique.
-It binds resource acquisition and release to initialization and
-destruction of a variable that holds the resource. But there are
-times when writing a special class for such variable is not worth
-the effort.
-
-This is when _scope_exit_ macro comes into play. You put resource
-acquisition directly in your code and next to it you write a code
-that releases the resource.
-
-Read _Tutorial_ to find out how to write programs with
-_scope_exit_ or jump straight to the _Reference_ section.
-
-[endsect]
-
-[section:tutorial Tutorial]
-
-Imagine that you want to make many modifications to data members
-of the `World` class in the `World::addPerson` function.
-You start with adding a new `Person` object to a vector of persons:
-
- void World::addPerson(Person const& person) {
- bool commit = false;
- m_persons.push_back(person); // (1) direct action
-
-Some operation down the road may throw an exception and all changes
-to involved objects should be rolled back. This all-or-nothing semantic
-is also known as _strong_guarantee_.
-
-In particular, last added person must be deleted from `m_persons` when
-the function throws. All you need is to define a delayed action (release
-of a resource) right after the direct action (resource acquisition):
-
- void World::addPerson(Person const& aPerson) {
- bool commit = false;
- m_persons.push_back(aPerson); // (1) direct action
- BOOST_SCOPE_EXIT( (&commit)(&m_persons) )
- {
- if(!commit)
- m_persons.pop_back(); // (2) rollback action
- } BOOST_SCOPE_EXIT_END
-
- // ... // (3) other operations
-
- commit = true; // (4) turn all rollback actions into no-op
- }
+[section Getting Started]
 
-The block below point `(1)` is a _scope_exit_ declaration.
-Unlike point `(1)`, an execution of the _scope_exit_ body will be
-delayed until the end of the current scope. In this case it will be
-executed either after point `(4)` or on any exception.
-
-The _scope_exit_ declaration starts with `BOOST_SCOPE_EXIT` macro
-invocation which accepts _pp_seq_ of captured variables. If a capture
-starts with the ampersand sign `&`, a reference to the captured variable
-will be available inside the _scope_exit_ body; otherwise, a copy of the
-variable will be made after the point `(1)` and only the copy will be
-available inside the body.
-
-In the example above, variables `commit` and `m_persons` are passed
-by reference because the final value of the `commit` variable should
-be used to determine whether to execute rollback action or not and
-the action should modify the `m_persons` object, not its copy.
-This is a most common case but passing a variable by value is
-sometimes useful as well.
-
-Consider a more complex case where `World::addPerson` can save intermediate
-states at some points and roll back to the last saved state. You can
-use `Person::m_evolution` to store a version of changes and increment it
-to cancel all rollback actions associated with those changes.
-
-If you pass a current value of `m_evolution` stored in the `checkpoint`
-variable by value, it will remain unchanged until the end of aa scope
-and you can compare it with the final value of the `m_evolution`.
-If the latter wasn't incremented since you saved it, the rollback action
-inside the block should be executed:
+This section explains how to setup a system to use this library.
 
- void World::addPerson(Person const& aPerson) {
- m_persons.push_back(aPerson);
-
- // This block must be no-throw
- Person& person = m_persons.back();
- Person::evolution_t checkpoint = person.m_evolution;
-
- BOOST_SCOPE_EXIT( (checkpoint)(&person)(&m_persons) )
- {
- if(checkpoint == person.m_evolution)
- m_persons.pop_back();
- } BOOST_SCOPE_EXIT_END
-
- // ...
-
- checkpoint = ++person.m_evolution;
-
- // Assign new id to the person
- World::id_t const prev_id = person.m_id;
- person.m_id = m_next_id++;
- BOOST_SCOPE_EXIT( (checkpoint)(&person)(&m_next_id)(prev_id) )
- {
- if(checkpoint == person.m_evolution) {
- m_next_id = person.m_id;
- person.m_id = prev_id;
- }
- } BOOST_SCOPE_EXIT_END
-
- // ...
-
- checkpoint = ++person.m_evolution;
- }
+[section This Documentation]
 
-Full code listing can be found in [@../../example/world.cpp world.cpp].
+Programmers should have enough knowledge to use this library after reading the __Introduction__, __Getting_Started__, and __Tutorial__ sections.
+The __Reference__ section can be consulted at a later point for quick reference.
+All the other sections of this documentation can be considered optional.
+
+Some footnotes are marked by the word "*Rationale*".
+They explain reasons behind decisions made during the design and implementation of this library.
+
+In most of the examples presented in this documentation, the Boost.Detail/LightweightTest (=boost/detail/lightweight_test.hpp=) macro `BOOST_TEST` is used to check correctness conditions.
+The `BOOST_TEST` macro is conceptually similar to `assert` but a failure of the checked condition does not abort the program, instead it makes `boost::report_errors` return a non-zero program exit code.
+[footnote
+*Rationale.*
+Using Boost.Detail/LightweightTest allows to add the examples to the library regression tests so to make sure that they always compile and run correctly.
+]
 
 [endsect]
 
-[section:alternatives Alternatives]
+[section Compilers and Platforms]
 
-[h3 try-catch]
+The authors originally developed and tested the library on GNU Compiler Collection (GCC) C++ 3.3, 3.4, 4.1, 4.2, 4.5.3 (with and without C++11 features [^-std=c++0x]), Microsoft Visual C++ (MSVC) 8.0, and Intel 10.1 under Linux, Cygwin, and Windows 7.
+However, this library should be usable on any compiler that supports __Boost_Typeof__ except:
 
-This is an example of using a badly designed `File` class. An
-instance of `File` doesn't close a file in a destructor, a programmer
-is expected to call the `close` member function explicitly.
+* MSVC 7.1 and 8.0 fail to link if a function with __Boost_ScopeExit__ is included by multiple translation units.
+* GCC 3.3 cannot compile __Boost_ScopeExit__ inside a template (see [@http://lists.boost.org/Archives/boost/2007/02/116235.php] for details).
 
- File passwd;
- try {
- passwd.open("/etc/passwd");
- // ...
- passwd.close();
- }
- catch(...) {
- log("could not get user info");
- if(passwd.is_open())
- passwd.close();
- throw;
- }
+See the library [@http://www.boost.org/development/tests/release/developer/scope_exit.html regression test results] for detailed information on supported compilers and platforms.
+Check the library regression test [@../../test/Jamfile.v2 =Jamfile.v2=] for any special configuration that might be required for a specific compiler.
 
-Note the following:
+[endsect]
 
-* the `passwd` object is defined outside of the `try` block because
-this object is required inside the `catch` block to close the file,
-* the `passwd` object is not fully constructed until after the `open`
-member function returns, and
-* if opening throws, the `passwd.close()` should not be called,
-hence the call to `passwd.is_open()`.
+[section Installation]
 
-_scope_exit_ doesn't have any of these problems:
+This library is composed of header files only.
+Therefore there is no pre-compiled object file which needs to be installed.
+Programmers can simply instruct the compiler where to find the library header files (`-I` option on GCC, `/I` option on MSVC, etc) and compile code using the library.
 
- try {
- File passwd("/etc/passwd");
- BOOST_SCOPE_EXIT( (&passwd) ) {
- passwd.close();
- } BOOST_SCOPE_EXIT_END
- // ...
- }
- catch(...) {
- log("could not get user info");
- throw;
- }
+The library implementation uses __Boost_Typeof__ to automatically deduce the types of the __Boost_ScopeExit__ captured variables (see the __Tutorial__ section).
+In order to compile code in __typeof_emulation__ mode, all types should be properly registered using `BOOST_TYPEOF_REGISTER_TYPE` and `BOOST_TYPEOF_REGISTER_TEMPLATE`, or appropriate __Boost_Typeof__ headers should be included (see the source code of most examples presented in this documentation).
+
+[endsect]
+
+[endsect]
+
+[section Tutorial]
+
+This section illustrates how to use this library.
+
+[section Capturing Variables]
+
+Imagine that we want to make many modifications to data members of some `world` class in its `world::add_person` member function.
+We start with adding a new `person` object to a vector of persons:
+
+ void world::add_person(person const& a_person) {
+ bool commit = false;
+
+ persons_.push_back(a_person); // (1) direct action
+ ...
+
+Some operations down the road may throw an exception and all changes to involved objects should be rolled back.
+This all-or-nothing semantic is also known as __strong_guarantee__.
+
+In particular, the last added person must be deleted from `persons_` if the function throws.
+All we need is to define a delayed action (release of a resource) right after the direct action (resource acquisition).
+For example (see also [@../../test/world.cpp =world.cpp=]):
+
+[world]
+
+The block below point =(1)= is a __Boost_ScopeExit__ declaration.
+Unlike point =(1)=, an execution of the __Boost_ScopeExit__ body will be delayed until the end of the current scope. In this case it will be executed either after point =(4)= or on any exception.
+(On various versions of the GCC compiler, it is necessary to use [macroref BOOST_SCOPE_EXIT_TPL] instead of [macroref BOOST_SCOPE_EXIT] within templates, see later in this section for details.)
+
+The __Boost_ScopeExit__ declaration starts with the [macroref BOOST_SCOPE_EXIT] macro invocation which accepts a comma-separated list of captured variables (a __Boost_Preprocessor__ sequence is also accepted for compilers that do not support variadic macros and for backward compatibility with older versions of this library, see the __No_Variadic_Macros__ section).
+If a capture starts with the ampersand sign `&`, a reference to the captured variable will be available inside the __Boost_ScopeExit__ body; otherwise, a copy of the variable will be made after the __Boost_ScopeExit__ declaration at point =(1)= and only the copy will be available inside the body (in this case, the captured variable's type must be [@http://www.boost.org/doc/libs/release/doc/html/CopyConstructible.html `CopyConstructible`]).
+
+In the example above, the variables `commit` and `persons_` are captured by reference because the final value of the `commit` variable should be used to determine whether to execute rollback actions or not, and the action should modify the `persons_` object, not its copy.
+This is the most common case but passing a variable by value is sometimes useful as well.
+
+Finally, the end of the __Boost_ScopeExit__ body must be marked by the [macroref BOOST_SCOPE_EXIT_END] macro which must follow the closing curly bracket `}` of the __Boost_ScopeExit__ body.
+
+[important
+In order to comply with the [@http://www.stlport.org/doc/exception_safety.html STL exception safety requirements], the __Boost_ScopeExit__ body must never throw (because the library implementation executes the body within a destructor call).
+This is true for all __Boost_ScopeExit__ macros (including [macroref BOOST_SCOPE_EXIT_TPL] and [macroref BOOST_SCOPE_EXIT_ALL] seen below) on both C++03 and C++11.
+]
+
+Consider a more complex example where `world::add_person` can save intermediate states at some point and roll back to the last saved state.
+We use `person::evolution_` to store a version of the changes and increment it to cancel all rollback actions associated with those changes.
+If we pass a current value of `evolution_` stored in the `checkpoint` variable by value, it remains unchanged within the __Boost_ScopeExit__ body so we can compare it with the final value of `evolution_`.
+If the latter was not incremented since we saved it, the rollback action inside the __Boost_ScopeExit__ body should be executed.
+For example (see also [@../../test/world_checkpoint.cpp =world_checkpoint.cpp=]):
+
+[world_checkpoint]
+
+When multiple __Boost_ScopeExit__ blocks are declared within the same enclosing scope, the __Boost_ScopeExit__ bodies are executed in the reversed order of their declarations.
+
+[endsect]
+
+[section Capturing The Object `this`]
+
+Within a member function, it is also possible to capture the object `this`.
+However, the special symbol `this_` must be used instead of `this` in the __Boost_ScopeExit__ declaration and body to capture and access the object.
+For example (see also [@../../test/world_this.cpp =world_this.cpp=]):
+
+[world_this]
+
+It is not possible to capture the object `this_` by reference because C++ does not allow to take a reference to `this`.
+If the enclosing member function is constant then the captured object will also be constant, otherwise the captured object will be mutable.
+
+[endsect]
+
+[section Capturing No Variable]
+
+A __Boost_ScopeExit__ declaration can also capture no variable.
+In this case, the list of captured variables is replaced by the `void` keyword (similarly to the C++ syntax that allows to declare a function with no parameter using [^['result-type function-name]]`(void)`).
+[footnote
+*Rationale.*
+Unfortunately, it is not possible to simply invoke the __Boost_ScopeExit__ macro with no parameters as in `BOOST_SCOPE_EXIT()` because the C++ preprocessor cannot detect emptiness of a macro parameter when the parameter can start with a non-alphanumeric symbol (which is the case when capturing a variable by reference `&variable`).
+]
+For example, this can be useful when the __Boost_ScopeExit__ body only needs to access global variables (see also [@../../test/world_void.cpp =world_void.cpp=]):
+
+[world_void]
+
+(Both compilers with and without variadic macros use this same syntax for capturing no variable, see the __No_Variadic_Macros__ section for more information.)
 
-[h3 RAII]
+[endsect]
+
+[section Capturing All Variables (C++11 Only)]
+
+On C++11 compliers, it is also possible to capture all the variables in scope without naming them one-by-one using the special macro [macroref BOOST_SCOPE_EXIT_ALL] instead of [macroref BOOST_SCOPE_EXIT].
+[footnote
+*Rationale.*
+The [macroref BOOST_SCOPE_EXIT_ALL] macro is only defined on C++11 compilers for which the __Boost_Config__ macro `BOOST_NO_LAMBDAS` is not defined.
+Using [macroref BOOST_SCOPE_EXIT_ALL] on C++03 compilers for which `BOOST_NO_LAMBDAS` is defined will generate (possibly cryptic) compiler errors.
+Note that a new macro [macroref BOOST_SCOPE_EXIT_ALL] needed to be introduced instead of reusing [macroref BOOST_SCOPE_EXIT] because `BOOST_SCOPE_EXIT(&)` and `BOOST_SCOPE_EXIT(=)` cannot be distinguished from `BOOST_SCOPE_EXIT(void)` or `BOOST_SCOPE_EXIT(this_)` using the C++ preprocessor given that the symbols `&` and `=` are neither prefxied nor postfixed by alphanumeric tokens (this is not an issue for [macroref BOOST_SCOPE_EXIT_ALL] which always has the non-alphanumeric `&` or `=` as the first capture so the first capture tokens are simply never compared with neither `void` nor `this_` for this macro).
+]
+
+Following the same syntax adopted by C++11 lambda functions, the [macroref BOOST_SCOPE_EXIT_ALL] macro accepts a comma-separated list of captures which must start with either `&` or `=` to capture all variables in scope respectively by reference or by value (note that no variable name is specified by these leading captures).
+Additional captures of specific variables can follow the leading `&` or `=` and they will override the default reference or value captures.
+For example (see also [@../../test/world_checkpoint_all.cpp =world_checkpoint_all.cpp=]):
+
+[world_checkpoint_all]
+
+The first __Boost_ScopeExit__ declaration captures all variables in scope by reference but the variable `checkpoint` and the object `this` which are explicitly captured by value (in particular, `p` and `persons_` are implicitly captured by reference here).
+The second __Boost_ScopeExit__ declaration instead captures all variables in scope by value but `p` which is explicitly captured by reference (in particular, `checkpoint`, `prev_id`, and `this` are implicitly captured by value here).
+
+Note that the [macroref BOOST_SCOPE_EXIT_ALL] macro follows the C++11 lambda function syntax which is unfortunately different from the [macroref BOOST_SCOPE_EXIT] macro syntax.
+In particular:
+
+# The [macroref BOOST_SCOPE_EXIT_ALL] macro cannot capture data members without capturing the object `this` while that is not the case for [macroref BOOST_SCOPE_EXIT].
+[footnote
+At present, there seems to be some discussion to allow C++11 lambda functions to capture data members without capturing the object `this`.
+If the C++11 standard were changed to allow this, the [macroref BOOST_SCOPE_EXIT_ALL] macro syntax could be extended to be a superset of the [macroref BOOST_SCOPE_EXIT] macro while keeping full backward compatibility.
+]
+# The [macroref BOOST_SCOPE_EXIT_ALL] macro captures the object in scope using `this` instead of `this_`.
+[footnote
+On compilers that support the use of the `typename` outside templates as allowed by the C++11 standard, [macroref BOOST_SCOPE_EXIT_ALL] can use both `this` and `this_` to capture the object in scope (notably, this is not the case for the MSVC 10.0 compiler).
+]
+# The [macroref BOOST_SCOPE_EXIT_ALL] body is terminated by a semicolon `;` instead than by the [macroref BOOST_SCOPE_EXIT_END] macro.
+
+If programmers define the configuration macro [macroref BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS] then the [macroref BOOST_SCOPE_EXIT] macro implementation will use C++11 lamda functions and the [macroref BOOST_SCOPE_EXIT] macro will follow the same syntax of [macroref BOOST_SCOPE_EXIT_ALL] macro, which is the C++11 lambda function syntax.
+However, [macroref BOOST_SCOPE_EXIT] will no longer be backward compatible and older code using [macroref BOOST_SCOPE_EXIT] might no longer compile (if data members were explicitly captured).
+
+[endsect]
+
+[section Template Workaround (GCC)]
+
+Various versions of the GCC compiler do not compile [macroref BOOST_SCOPE_EXIT] inside templates (see the __Reference__ section for more information).
+As a workaround, [macroref BOOST_SCOPE_EXIT_TPL] should be used instead of [macroref BOOST_SCOPE_EXIT] in these cases.
+[footnote
+*Rationale.*
+GCC versions compliant with C++11 do not present this issue and given that [macroref BOOST_SCOPE_EXIT_ALL] is only available on C++11 compilers, there is no need for a `BOOST_SCOPE_EXIT_ALL_TPL` macro.
+]
+The [macroref BOOST_SCOPE_EXIT_TPL] macro has the exact same syntax of [macroref BOOST_SCOPE_EXIT].
+For example (see also [@../../test/world_tpl.cpp =world_tpl.cpp=]):
+
+[world_tpl]
+
+It is recommended to always use [macroref BOOST_SCOPE_EXIT_TPL] within templates so to maximize portability among different compilers.
+
+[endsect]
+
+[section Same Line Expansions]
+
+In general, it is not possible to expand the [macroref BOOST_SCOPE_EXIT], [macroref BOOST_SCOPE_EXIT_TPL], [macroref BOOST_SCOPE_EXIT_END], and [macroref BOOST_SCOPE_EXIT_ALL] macros multiple times on the same line.
+[footnote
+*Rationale.*
+The library macros internally use `__LINE__` to generate unique identifiers.
+Therefore, if the same macro is expanded more than on time on the same line, the generated identifiers will no longer be unique and the code will not compile.
+(This restriction does not apply to MSVC and other compilers that provide the non-standard `__COUNTER__` macro.)
+]
+
+Therefore, this library provides additional macros [macroref BOOST_SCOPE_EXIT_ID], [macroref BOOST_SCOPE_EXIT_ID_TPL], [macroref BOOST_SCOPE_EXIT_END_ID], and [macroref BOOST_SCOPE_EXIT_ALL_ID] which can be expanded multiple times on the same line as long as programmers specify a unique identifiers as the macros' first parameters.
+The unique identifier can be any token (not just numeric) that can be concatenated by the C++ preprocessor (e.g., `scope_exit_number_1_at_line_123`).
+[footnote
+Because there are restrictions on the set of tokens that the C++ preprocessor can concatenate and because not all compilers correctly implement these restrictions, it is in general recommended to specify unique identifiers as a combination of alphanumeric tokens.
+]
+
+The [macroref BOOST_SCOPE_EXIT_ID], [macroref BOOST_SCOPE_EXIT_ID_TPL], and [macroref BOOST_SCOPE_EXIT_ALL_ID] macros accept a capture list using the exact same syntax as [macroref BOOST_SCOPE_EXIT] and [macroref BOOST_SCOPE_EXIT_ALL] respectively.
+For example (see also [@../../test/same_line.cpp =same_line.cpp=]):
+
+[same_line]
+
+As shown by the example above, the [macroref BOOST_SCOPE_EXIT_ID], [macroref BOOST_SCOPE_EXIT_ID_TPL], [macroref BOOST_SCOPE_EXIT_END_ID], and [macroref BOOST_SCOPE_EXIT_ALL_ID] macros are especially useful when it is necessary to invoke them multiple times within user-defined macros (because the C++ preprocessor expands all nested macros on the same line).
+
+[endsect]
+
+[endsect]
+
+[section:alternatives Annex: Alternatives]
+
+This section presents some alternative and related work to __Boost_ScopeExit__.
+
+[heading Try-Catch]
+
+This is an example of using a badly designed `file` class.
+An instance of `file` does not close the file in its destructor, a programmer is expected to call the `close` member function explicitly.
+For example (see also [@../../example/try_catch.cpp =try_catch.cpp=]):
 
-_RAII_ is absolutely perfect for the `File` class introduced above.
-Use of a properly designed `File` class would look like:
+[try_catch_bad]
+
+Note the following issues with this approach:
+
+# The `passwd` object is defined outside of the `try` block because this object is required inside the `catch` block to close the file.
+# The `passwd` object is not fully constructed until after the `open`
+member function returns.
+# If opening throws, the `passwd.close()` should not be called, hence the call to `passwd.is_open()`.
+
+The __Boost_ScopeExit__ approach does not have any of these issues.
+For example (see also [@../../example/try_catch.cpp =try_catch.cpp=]):
+
+[try_catch_good]
+
+[heading RAII]
+
+__RAII__ is absolutely perfect for the `file` class introduced above.
+Use of a properly designed `file` class would look like:
 
         try {
- File passwd("/etc/passwd");
+ file passwd("/etc/passwd");
             // ...
- }
- catch(...) {
- log("could not get user info");
+ } catch(...) {
+ std::clog << "could not get user info" << std::endl;
             throw;
         }
 
-However, using _RAII_ to build up a _strong_guarantee_ could introduce
-a lot of non-reusable _RAII_ types. For example:
+However, using __RAII__ to build up a __strong_guarantee__ could introduce a lot of non-reusable __RAII__ types.
+For example:
 
- m_persons.push_back(person);
- pop_back_if_not_commit pop_back_if_not_commit_guard(commit, m_persons);
+ persons_.push_back(a_person);
+ pop_back_if_not_commit pop_back_if_not_commit_guard(commit, persons_);
 
-The `pop_back_if_not_commit` class is either defined out of the scope or
-as a local class:
+The `pop_back_if_not_commit` class is either defined out of the scope or as a local class:
 
         class pop_back_if_not_commit {
- bool m_commit;
- std::vector<Person>& m_vec;
+ bool commit_;
+ std::vector<person>& vec_;
             // ...
             ~pop_back_if_not_commit() {
- if(!m_commit)
- m_vec.pop_back();
+ if(!commit_) vec_.pop_back();
             }
         };
 
-In some cases _strong_guarantee_ can be accomplished with standard utilities:
+In some cases __strong_guarantee__ can be accomplished with standard utilities:
 
- std::auto_ptr<Person> spSuperMan(new Superman);
- m_persons.push_back(spSuperMan.get());
- spSuperMan.release(); // m_persons successfully took ownership.
+ std::auto_ptr<Person> superman_ptr(new superman());
+ persons_.push_back(superman_ptr.get());
+ superman_ptr.release(); // persons_ successfully took ownership
 
-or with specialized containers such as _ptr_container_ or
-_multi_index_.
+Or with specialized containers such as __Boost_PointerContainer__ or __Boost_Multi_Index__.
 
-[h3 _scope_guard_]
+[heading Scope Guards]
 
-Imagine that you add a new currency rate:
+Imagine that a new currency rate is introduced before performing a transaction (see also []):
 
- bool commit = false;
- std::string currency("EUR");
- double rate = 1.3326;
- std::map<std::string, double> rates;
- bool currency_rate_inserted =
- rates.insert(std::make_pair(currency, rate)).second;
-
-and then continue a transaction. If it cannot be completed, you erase
-the currency from `rates`. This is how you can do this with _scope_guard_
-and _lambda_:
-
- using namespace boost::lambda;
+[scope_guard_decl]
         
- ON_BLOCK_EXIT(
- if_(currency_rate_inserted && !_1) [
- bind(
- static_cast<
- std::map<std::string,double>::size_type (std::map<std::string,double>::*)(std::string const&)
- >(&std::map<std::string,double>::erase)
- , &rates
- , currency
- )
- ]
- , boost::cref(commit)
- );
+If the transaction does not complete, the currency must be erased from `rates`.
+This can be done with __ScopeGuard__ and __Boost_Lambda__ (or __Boost_Phoenix__):
         
- // ...
-
- commit = true;
+ using namespace boost::lambda;
 
-Note that
+ ON_BLOCK_EXIT(
+ if_(currency_rate_inserted && !_1) [
+ bind(
+ static_cast<
+ std::map<std::string, double>::size_type
+ (std::map<std::string, double>::*)(std::string const&)
+ >(&std::map<std::string, double>::erase)
+ , &rates
+ , currency
+ )
+ ]
+ , boost::cref(commit)
+ );
 
-* Boost.lambda expressions are hard to write correctly, for example,
-overloaded function must be explicitly casted, as demonstrated in
-this example,
-* condition in `if_` expression refers to `commit` variable indirectly
-through the `_1` placeholder,
-* setting a breakpoint inside `if_[ ... ]` requires in-depth knowledge
-of _lambda_ and debugging techniques.
-
-This code will look much better with native lambda expressions proposed
-for C++0x:
-
- ON_BLOCK_EXIT(
- [currency_rate_inserted, &commit, &rates, &currency]() -> void
- {
- if(currency_rate_inserted && !commit)
- rates.erase(currency);
- }
- );
+ // ...
 
-With _scope_exit_ you can simply do
+ commit = true;
 
- BOOST_SCOPE_EXIT( (currency_rate_inserted)(&commit)(&rates)(&currency) )
- {
- if(currency_rate_inserted && !commit)
- rates.erase(currency);
- } BOOST_SCOPE_EXIT_END
-
- // ...
-
- commit = true;
+Note the following issues with this approach:
 
-[h3 C++0x]
+# __Boost_Lambda__ expressions are hard to write correctly (e.g., overloaded functions must be explicitly casted, as demonstrated in the example above).
+# The condition in the `if_` expression refers to `commit` variable indirectly through the `_1` placeholder reducing readability.
+# Setting a breakpoint inside `if_[...]` requires in-depth knowledge of __Boost_Lambda__ and debugging techniques.
 
-In future releases _scope_exit_ will take advantages of C++0x features.
+This code will look much better with C++11 lambdas:
 
-* Passing capture list as _pp_seq_ will be replaced with a traditional
-macro invocation style:
+ ON_BLOCK_EXIT(
+ [currency_rate_inserted, &commit, &rates, &currency]() {
+ if(currency_rate_inserted && !commit) rates.erase(currency);
+ }
+ );
+
+ // ...
+
+ commit = true;
 
- BOOST_SCOPE_EXIT(currency_rate_inserted, &commit, &rates, &currency)
- {
- if(currency_rate_inserted && !commit)
- rates.erase(currency);
- } BOOST_SCOPE_EXIT_END
-
-* `BOOST_SCOPE_EXIT_END` will be replaced with a semicolon:
+With __Boost_ScopeExit__ we can simply do the following (see also [@../../example/scope_guard.cpp =scope_guard.cpp=]):
 
- BOOST_SCOPE_EXIT(currency_rate_inserted, &commit, &rates, &currency)
- {
- if(currency_rate_inserted && !commit)
- rates.erase(currency);
- };
+[scope_guard_exit]
 
-* Users will be able to capture local variables implicitly with lambda
-capture defaults `&` and `=`:
+[heading The D Programming Language]
 
- BOOST_SCOPE_EXIT(&, currency_rate_inserted)
- {
- if(currency_rate_inserted && !commit)
- rates.erase(currency);
- };
+__Boost_ScopeExit__ is similar to __D_scope_exit__ feature built into the __D__ programming language.
 
-* It will be possible to capture `this` pointer.
+A curious reader may notice that the library does not implement `scope(success)` and `scope(failure)` of the __D__ language.
+Unfortunately, these are not possible in C++ because failure or success conditions cannot be determined by calling `std::uncaught_exception` (see [@http://www.gotw.ca/gotw/047.htm Guru of the Week #47] for details about `std::uncaught_exception` and if it has any good use at all).
+However, this is not a big problem because these two __D__'s constructs can be expressed in terms of __D_scope_exit__ and a `bool commit` variable (similarly to some examples presented in the __Tutorial__ section).
 
-[h3 The D Programming Language]
+[heading C++11 Lambdas]
 
-_ScopeExit_ is similar to _D_scope_exit_ feature built
-into the _D_ programming language.
+Using C++11 lambdas, it is relatively easy to implement the __Boost_ScopeExit__ construct.
+For example (see also [@../../example/world_cxx11_lambda.cpp =world_cxx11_lambda.cpp=]):
 
-A curious reader may notice that the library doesn't implement
-`scope(success)` and `scope(failure)` of the _D_ language.
-Unfortunately, it's not possible in C++ because failure or success
-condition cannot be determined by calling `std::uncaught_exception`.
-It's not a big problem, though. These two constructs can be
-expressed in terms of _D_scope_exit_ and a `bool commit` variable
-as explained in _Tutorial_. Refer to
-[@http://www.gotw.ca/gotw/047.htm Guru of the Week #47]
-for more details about `std::uncaught_exception` and if it has
-any good use at all.
+[world_cxx11_lambda]
 
-[endsect]
-
-[section:compilers Supported Compilers]
-
-The library should be usable on any compiler that supports _typeof_
-except
-
-* MSVC 7.1 and 8.0 fail to link if a function with _scope_exit_
-is included by multiple translation units.
-* GCC 3.3 can't compile _scope_exit_ inside a template. See
-[@http://lists.boost.org/Archives/boost/2007/02/116235.php this thread]
-for more details.
-
-The author tested the library on GCC 3.3, 3.4, 4.1, 4.2 and Intel 10.1.
+However, this library allows to program the __Boost_ScopeExit__ construct in a way that is portable between C++03 and C++11 compilers.
 
 [endsect]
 
-[section:conf Configuration]
+[section:no_variadic_macros Annex: No Variadic Macros]
 
-Normally, no configuration is required for the library but
-note that the library depends on _typeof_ and you may want
-to configure or enforce _typeof_emulation_.
+This section presents an alternative syntax for compilers without variadic macro support.
 
-[endsect]
+[heading Sequence Syntax]
 
-[section:ref Reference]
+Most modern compilers support variadic macros (notably, these include GCC, MSVC, and all C++11 compilers).
+[footnote
+A C++ compiler does not support variadic macros if the __Boost_Config__ macro `BOOST_NO_VARIADIC_MACROS` is defined for that compiler.
+]
+However, in the rare case that programmers need to use this library on a complier without variaidc macros, this library also allows to specify the capture list using a __Boost_Preprocessor__ sequence where tokens are separated by round parenthesis `()`:
 
-[h3 BOOST_SCOPE_EXIT]
+ (capture1) (capture2) ... // All compilers.
 
-A _scope_exit_ declaration has the following synopsis:
+Instead of the comma-separated list that we have seen so far which requires variadic macros:
 
- #include <boost/scope_exit.hpp>
+ capture1, capture2, ... // Only compilers with variadic macros.
 
- BOOST_SCOPE_EXIT ( scope-exit-capture-list )
- function-body
- BOOST_SCOPE_EXIT_END
+For example, the following syntax is accepted on all compilers with and without variadic macros (see also [@../../test/world_seq.cpp =world_seq.cpp=] and [@../../test/world.cpp =world.cpp=]):
 
-where
+[table
+[ [Boost.Preprocessor Sequence (All Compilers)] [Comma-Separated List (Variadic Macros Only)] ]
+[ [[world_seq]] [[world]] ]
+]
 
- scope-exit-capture-list:
- ( scope-exit-capture )
- scope-exit-capture-list ( scope-exit-capture )
-
- scope-exit-capture:
- identifier
- &identifier
-
-The _scope_exit_ declaration schedules an execution of `scope-exit-body`
-at the end of the current scope. The `scope-exit-body` statements are
-executed in the reverse order of _scope_exit_ declarations in the given
-scope. The scope must be local.
-
-Each `identifier` in `scope-exit-capture-list` must be a valid name
-in enclosing scope and it must appear exactly once in the list.
-If a `scope-exit-capture` starts with the ampersand sign `&`, the
-corresponding `identifier` will be available inside `scope-exit-body`;
-otherwise, a copy of it will be made at the point of _scope_exit_
-declaration and that copy will be available inside `scope-exit-body`.
-In the latter case, the `idenitifer` must be `CopyConstructible`.
-
-Only identifiers listed in `scope-exit-capture-list`, static variables,
-`extern` variables and functions, and enumerations from the enclosing
-scope can be used inside the `scope-exit-body`.
-
-[note `this` pointer is not an identifier and cannot be passed to
-` scope-exit-capture-list`.]
-
-The _scope_exit_ uses _typeof_ to determine types of
-`scope-exit-capture-list` elements. In order to compile code in
-_typeof_emulation_ mode, all types should be registered with
-_typeof_REGISTER_TYPE_ or _typeof_REGISTER_TEMPLATE_ macros,
-or appropriate _typeof_ headers should be included.
-
-[h3 BOOST_SCOPE_EXIT_TPL]
-
-This macro is a workaround for various versions of gcc. These compilers
-don't compile _scope_exit_ declaration inside function templates. As a
-workaround, the `_TPL` suffix should be appended to `BOOST_SCOPE_EXIT`.
-
-The problem boils down to the following code:
-
- template<class T> void foo(T const& t) {
- int i = 0;
- struct Local {
- typedef __typeof__(i) typeof_i;
- typedef __typeof__(t) typeof_t;
- };
- typedef Local::typeof_i i_type;
- typedef Local::typeof_t t_type;
- }
-
- int main() { foo(0); }
+Note how the same macros accept both syntaxes on compilers with variadic macros and only the __Boost_Preprocessor__ sequence syntax on compilers without variadic macros.
+Older versions of this library used to only support the __Boost_Preprocessor__ sequence syntax so this syntax is supported also for backward compatibility.
+However, in the current version of this library and on compilers with variadic macros, the comma-separated syntax is preferred because it is more readable.
+
+Finally, an empty capture list is always specified using `void` on compilers with and without variaidc macros (see also [@../../test/world_void.cpp =world_void.cpp=]):
+
+[world_void]
+
+[heading Examples]
+
+For reference, the following is a list of most of the examples presented in this documentation reprogrammed using the __Boost_Preprocessor__ sequence syntax instead of comma-separated lists (in alphabetic order):
+
+[table
+ [ [Files] ]
+ [ [[@../../test/same_line_seq.cpp =same_line_seq.cpp=]] ]
+ [ [[@../../example/scope_guard_seq.cpp =scope_guard_seq.cpp=]] ]
+ [ [[@../../example/try_catch_seq.cpp =try_catch_seq.cpp=]] ]
+ [ [[@../../test/world_checkpoint_all_seq.cpp =world_checkpoint_all_seq.cpp=]] ]
+ [ [[@../../test/world_checkpoint_seq.cpp =world_checkpoint_seq.cpp=]] ]
+ [ [[@../../test/world_this_seq.cpp =world_this_seq.cpp=]] ]
+ [ [[@../../test/world_tpl_seq.cpp =world_tpl_seq.cpp=]] ]
+]
 
-This can be fixed by adding `typename` in front of `Local::typeof_i` and
-`Local::typeof_t`.
+[endsect]
 
-See also [@http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37920 GCC bug 37920].
+[xinclude reference.xml]
 
-[note Although `BOOST_SCOPE_EXIT_TPL` has the same suffix as the
-`BOOST_TYPEOF_TPL`, it doesn't follow a convention of the _typeof_.]
+[section Acknowledgements]
 
-[endsect]
+Alexander Nasonov is the original library author.
 
-[section:acknowledge Acknowledge]
+Lorenzo Caminiti added variadic macro support, capture of the object `this_`, empty captures using `void`, and `BOOST_SCOPE_EXIT_ALL`.
 
-(in chronological order)
+Thanks to the following people (in chronological order):
 
-Maxim Yegorushkin for sending me a code where he used a local struct
-to clean up resources.
+Maxim Yegorushkin for sharing code where he used a local struct to clean up resources;
 
-Andrei Alexandrescu for pointing me to _D_scope_exit_ construct of
-the _D_ programming language.
+Andrei Alexandrescu for pointing out the __D_scope_exit__ construct of the __D__ programming language;
 
-Pavel Vozenilek and Maxim Yanchenko for reviews of early drafts of
-the library.
+Pavel Vozenilek and Maxim Yanchenko for reviews of early drafts of the library;
 
-Steven Watanabe for his valuable ideas.
+Steven Watanabe for his valuable ideas;
 
-Jody Hagins for good comments that helped to significantly improve the documentation.
+Jody Hagins for good comments that helped to significantly improve the documentation;
 
-Richard Webb for testing the library on MSVC compiler.
+Richard Webb for testing the library on MSVC compiler;
+
+Adam Butcher for a workaround to error C2355 when deducing the type of `this` on some MSVC versions.
 
 [endsect]
+

Copied: branches/release/libs/scope_exit/example/Jamfile.v2 (from r77042, /trunk/libs/scope_exit/example/Jamfile.v2)
==============================================================================
--- /trunk/libs/scope_exit/example/Jamfile.v2 (original)
+++ branches/release/libs/scope_exit/example/Jamfile.v2 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -8,15 +8,16 @@
 
 import testing ;
 
-# Compile sequence syntax also forcing no varadic macros.
+# Sun does not automatically detect type-of emulation mode (force it).
+project : requirements <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
 
 run try_catch.cpp ;
 run try_catch_seq.cpp ;
-run try_catch_seq.cpp : : : <define>BOOST_NO_VARIADIC_MACROS
- : try_catch_seq_no_variadics : ;
+run try_catch_seq_nova.cpp ;
 
 run scope_guard.cpp ;
 run scope_guard_seq.cpp ;
-run scope_guard_seq.cpp : : : <define>BOOST_NO_VARIADIC_MACROS
- : scope_guard_seq_no_variadics : ;
+run scope_guard_seq_nova.cpp ;
+
+run world_cxx11_lambda.cpp ;
 

Copied: branches/release/libs/scope_exit/example/scope_guard.cpp (from r77042, /trunk/libs/scope_exit/example/scope_guard.cpp)
==============================================================================
--- /trunk/libs/scope_exit/example/scope_guard.cpp (original)
+++ branches/release/libs/scope_exit/example/scope_guard.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,7 +6,14 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/scope_exit
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/scope_exit.hpp>
+#include <boost/typeof/std/string.hpp>
+#include <boost/typeof/std/map.hpp>
 #include <map>
 #include <string>
 #include <utility>
@@ -35,3 +42,5 @@
     return 0;
 }
 
+#endif // variadic macros
+

Copied: branches/release/libs/scope_exit/example/scope_guard_seq.cpp (from r77042, /trunk/libs/scope_exit/example/scope_guard_seq.cpp)
==============================================================================
--- /trunk/libs/scope_exit/example/scope_guard_seq.cpp (original)
+++ branches/release/libs/scope_exit/example/scope_guard_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,6 +7,8 @@
 // Home at http://www.boost.org/libs/scope_exit
 
 #include <boost/scope_exit.hpp>
+#include <boost/typeof/std/string.hpp>
+#include <boost/typeof/std/map.hpp>
 #include <map>
 #include <string>
 #include <utility>
@@ -21,8 +23,7 @@
 
     BOOST_SCOPE_EXIT( (currency_rate_inserted) (&commit) (&rates)
             (&currency) ) {
- if(currency_rate_inserted && !commit)
- rates.erase(currency);
+ if(currency_rate_inserted && !commit) rates.erase(currency);
     } BOOST_SCOPE_EXIT_END
 
     // ...

Copied: branches/release/libs/scope_exit/example/try_catch.cpp (from r77042, /trunk/libs/scope_exit/example/try_catch.cpp)
==============================================================================
--- /trunk/libs/scope_exit/example/try_catch.cpp (original)
+++ branches/release/libs/scope_exit/example/try_catch.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,20 +6,28 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/scope_exit
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/scope_exit.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
 #include <iostream>
 
 struct file {
- file() : open_(false) {}
+ file(void) : open_(false) {}
     file(char const* path) : open_(false) { open(path); }
 
     void open(char const* path) { open_ = true; }
     void close(void) { open_ = false; }
-
     bool is_open(void) const { return open_; }
+
 private:
     bool open_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(file)
 
 void bad(void) {
     //[try_catch_bad
@@ -56,3 +64,5 @@
     return 0;
 }
 
+#endif // variadic macros
+

Copied: branches/release/libs/scope_exit/example/try_catch_seq.cpp (from r77042, /trunk/libs/scope_exit/example/try_catch_seq.cpp)
==============================================================================
--- /trunk/libs/scope_exit/example/try_catch_seq.cpp (original)
+++ branches/release/libs/scope_exit/example/try_catch_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,19 +7,22 @@
 // Home at http://www.boost.org/libs/scope_exit
 
 #include <boost/scope_exit.hpp>
+#include <boost/typeof/typeof.hpp>
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
 #include <iostream>
 
 struct file {
- file() : open_(false) {}
+ file(void) : open_(false) {}
     file(char const* path) : open_(false) { open(path); }
 
     void open(char const* path) { open_ = true; }
     void close(void) { open_ = false; }
-
     bool is_open(void) const { return open_; }
+
 private:
     bool open_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(file)
 
 void bad(void) {
     //[try_catch_bad_seq

Deleted: branches/release/libs/scope_exit/example/world.cpp
==============================================================================
--- branches/release/libs/scope_exit/example/world.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,114 +0,0 @@
-// Copyright Alexander Nasonov 2009
-//
-// 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)
-
-#include <vector>
-#include <ostream>
-
-#include <boost/foreach.hpp>
-#include <boost/scope_exit.hpp>
-
-// The following is required for typeof emulation mode:
-#include <boost/typeof/typeof.hpp>
-#include <boost/typeof/std/vector.hpp>
-#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-
-class World;
-class Person
-{
- friend class World;
-public:
- typedef unsigned int id_t;
- typedef unsigned int evolution_t;
-
- Person()
- : m_id(0)
- , m_evolution(0)
- {}
-
- friend std::ostream& operator<<(std::ostream& o, Person const& p)
- {
- return o << "Person(" << p.m_id << ", " << p.m_evolution << ')';
- }
-private:
- id_t m_id;
- evolution_t m_evolution;
-};
-
-BOOST_TYPEOF_REGISTER_TYPE(Person)
-
-class World
-{
-public:
- typedef unsigned int id_t;
-
- World()
- : m_next_id(1)
- {}
- void addPerson(Person const& aPerson);
-
- friend std::ostream& operator<<(std::ostream& o, World const& w)
- {
- o << "World(" << w.m_next_id << ", {";
- BOOST_FOREACH(Person const& p, w.m_persons)
- {
- o << ' ' << p << ',';
- }
- return o << "})";
- }
-private:
- id_t m_next_id;
- std::vector<Person> m_persons;
-};
-
-BOOST_TYPEOF_REGISTER_TYPE(World)
-
-void World::addPerson(Person const& aPerson) {
- m_persons.push_back(aPerson);
-
- // This block must be no-throw
- Person& person = m_persons.back();
- Person::evolution_t checkpoint = person.m_evolution;
-
- BOOST_SCOPE_EXIT( (checkpoint)(&person)(&m_persons) )
- {
- if(checkpoint == person.m_evolution)
- m_persons.pop_back();
- } BOOST_SCOPE_EXIT_END
-
- // ...
-
- checkpoint = ++person.m_evolution;
-
- // Assign new id to the person
- World::id_t const prev_id = person.m_id;
- person.m_id = m_next_id++;
- BOOST_SCOPE_EXIT( (checkpoint)(&person)(&m_next_id)(prev_id) )
- {
- if(checkpoint == person.m_evolution) {
- m_next_id = person.m_id;
- person.m_id = prev_id;
- }
- } BOOST_SCOPE_EXIT_END
-
- // ...
-
- checkpoint = ++person.m_evolution;
-}
-
-#include <iostream>
-
-int main()
-{
- Person adam, eva;
- std::cout << adam << '\n';
- std::cout << eva << '\n';
-
- World w;
- w.addPerson(adam);
- w.addPerson(eva);
- std::cout << w << '\n';
-}
-

Modified: branches/release/libs/scope_exit/index.html
==============================================================================
--- branches/release/libs/scope_exit/index.html (original)
+++ branches/release/libs/scope_exit/index.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1,16 +1,15 @@
-
-<!--
-Copyright 2009 Alexander Nasonov.
-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)
--->
-
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
-<head>
+ <head>
     <meta http-equiv="refresh" content="0; URL=doc/html/index.html">
-</head>
-<body>
-Automatic redirection failed, please go to
-doc/html/index.html
-</body>
+ </head>
+ <body>
+ Automatic redirection failed, click this
+ link &nbsp;<hr>
+ <p>© Copyright Alexander Nasonov, Lorenzo Caminiti, 2006-2012</p>
+ <p>Distributed under the Boost Software License, Version 1.0 (see
+ accompanying file <a href="../../LICENSE_1_0.txt">
+ LICENSE_1_0.txt</a> or a copy at
+ www.boost.org/LICENSE_1_0.txt)</p>
+ </body>
 </html>

Modified: branches/release/libs/scope_exit/test/Jamfile.v2
==============================================================================
--- branches/release/libs/scope_exit/test/Jamfile.v2 (original)
+++ branches/release/libs/scope_exit/test/Jamfile.v2 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1,25 +1,53 @@
-# Copyright Alexander Nasonov 2007
-#
-# 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)
 
-# TODO: get rid of dummy .cpp files that only #include other .cpp file.
+# Copyright (C) 2006-2009, 2012 Alexander Nasonov
+# Copyright (C) 2012 Lorenzo Caminiti
+# Distributed under the Boost Software License, Version 1.0
+# (see accompanying file LICENSE_1_0.txt or a copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+# Home at http://www.boost.org/libs/scope_exit
 
 import testing ;
 
-run native.cpp ../../../libs/test/build//boost_test_exec_monitor : : : <define>BOOST_TYPEOF_NATIVE : ;
-run emulation.cpp ../../../libs/test/build//boost_test_exec_monitor : : : <define>BOOST_TYPEOF_EMULATION : ;
-
-run native_tpl.cpp ../../../libs/test/build//boost_test_exec_monitor : : : <define>BOOST_TYPEOF_NATIVE : ;
-run emulation_tpl.cpp ../../../libs/test/build//boost_test_exec_monitor : : : <define>BOOST_TYPEOF_EMULATION : ;
-
-compile-fail native_const_error.cpp : <define>BOOST_TYPEOF_NATIVE ;
-compile-fail emulation_const_error.cpp : <define>BOOST_TYPEOF_EMULATION ;
-
-compile-fail native_cv_error.cpp : <define>BOOST_TYPEOF_NATIVE ;
-compile-fail emulation_cv_error.cpp : <define>BOOST_TYPEOF_EMULATION ;
-
-run native_tu_test.cpp native_tu1.cpp native_tu2.cpp ../../../libs/test/build//boost_test_exec_monitor : : : <define>BOOST_TYPEOF_NATIVE : ;
-run emulation_tu_test.cpp native_tu1.cpp native_tu2.cpp ../../../libs/test/build//boost_test_exec_monitor : : : <define>BOOST_TYPEOF_EMULATION : ;
+rule run-vaseq ( command target )
+{
+ # Sun does not automatically detect type-of emulation mode (force it).
+ run $(target).cpp : : : <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
+ run $(target)_seq.cpp : : : <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
+ run $(target)_seq_nova.cpp : : :
+ <toolset>sun:<define>BOOST_TYPEOF_EMULATION ;
+}
+
+rule run-typeof ( native_target emulation_target )
+{
+ run $(native_target).cpp : : : <define>BOOST_TYPEOF_NATIVE ;
+ run $(native_target).cpp : : : <define>BOOST_TYPEOF_EMULATION :
+ $(emulation_target) : ;
+}
+
+rule compile-fail-typeof ( native_target emulation_target )
+{
+ compile-fail $(native_target).cpp : <define>BOOST_TYPEOF_NATIVE ;
+ compile-fail $(native_target).cpp : <define>BOOST_TYPEOF_EMULATION :
+ $(emulation_target) : ;
+}
+
+run-vaseq run same_line ;
+run-vaseq run world ;
+run-vaseq run world_checkpoint ;
+run-vaseq run world_checkpoint_all ;
+run-vaseq run world_this ;
+run-vaseq run world_tpl ;
+run world_void.cpp ;
+run world_void_nova.cpp ;
+
+run-typeof native emulation ;
+run-typeof native_tpl emulation_tpl ;
+run-typeof native_this emulation_this ;
+run-typeof native_this_tpl emulation_this_tpl ;
+compile-fail-typeof native_const_error emulation_const_error ;
+compile-fail-typeof native_cv_error emulation_cv_error ;
+run native_tu_test.cpp native_tu1.cpp native_tu2.cpp : : :
+ <define>BOOST_TYPEOF_NATIVE ;
+run native_tu_test.cpp native_tu1.cpp native_tu2.cpp : : :
+ <define>BOOST_TYPEOF_EMULATION : emulation_tu_test : ;
 

Deleted: branches/release/libs/scope_exit/test/emulation.cpp
==============================================================================
--- branches/release/libs/scope_exit/test/emulation.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,8 +0,0 @@
-// Copyright Alexander Nasonov 2007-2009
-//
-// 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)
-
-#include "native.cpp"
-

Deleted: branches/release/libs/scope_exit/test/emulation_const_error.cpp
==============================================================================
--- branches/release/libs/scope_exit/test/emulation_const_error.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,7 +0,0 @@
-// Copyright Alexander Nasonov 2007-2009
-//
-// 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)
-
-#include "native_const_error.cpp"

Deleted: branches/release/libs/scope_exit/test/emulation_cv_error.cpp
==============================================================================
--- branches/release/libs/scope_exit/test/emulation_cv_error.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,7 +0,0 @@
-// Copyright Alexander Nasonov 2007-2009
-//
-// 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)
-
-#include "native_cv_error.cpp"

Deleted: branches/release/libs/scope_exit/test/emulation_tpl.cpp
==============================================================================
--- branches/release/libs/scope_exit/test/emulation_tpl.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,8 +0,0 @@
-// Copyright Alexander Nasonov 2007-2009
-//
-// 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)
-
-#include "native_tpl.cpp"
-

Deleted: branches/release/libs/scope_exit/test/emulation_tu_test.cpp
==============================================================================
--- branches/release/libs/scope_exit/test/emulation_tu_test.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,7 +0,0 @@
-// Copyright Alexander Nasonov 2007-2009
-//
-// 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)
-
-#include "native_tu_test.cpp"

Modified: branches/release/libs/scope_exit/test/native.cpp
==============================================================================
--- branches/release/libs/scope_exit/test/native.cpp (original)
+++ branches/release/libs/scope_exit/test/native.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1,135 +1,121 @@
-// Copyright Alexander Nasonov 2007-2008
-//
-// 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)
 
-#include <iostream>
-#include <ostream>
-#include <string>
+// Copyright (C) 2006-2009, 2012 Alexander Nasonov
+// Copyright (C) 2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/scope_exit
 
 #include <boost/scope_exit.hpp>
-
+#include <boost/config.hpp>
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/string.hpp>
-#include <boost/test/unit_test.hpp>
-
-using namespace boost::unit_test;
+#include <boost/detail/lightweight_test.hpp>
+#include <iostream>
+#include <ostream>
+#include <string>
 
 std::string g_str;
 
 template<int Dummy = 0>
-struct Holder
-{
+struct Holder {
     static long g_long;
 };
 
 template<int Dummy> long Holder<Dummy>::g_long;
 
-void test_non_local()
-{
+void test_non_local(void) {
     // ... and one local variable as well:
     int i = 0;
 
- BOOST_SCOPE_EXIT( (i) )
- {
- BOOST_CHECK(i == 0);
- BOOST_CHECK(Holder<>::g_long == 3);
- BOOST_CHECK(g_str == "try: g_str");
+ BOOST_SCOPE_EXIT(void) {
+ BOOST_TEST(Holder<>::g_long == 3);
     } BOOST_SCOPE_EXIT_END
 
- BOOST_SCOPE_EXIT( (&i) )
- {
- BOOST_CHECK(i == 3);
- BOOST_CHECK(Holder<>::g_long == 3);
- BOOST_CHECK(g_str == "try: g_str");
+ BOOST_SCOPE_EXIT( (i) ) {
+ BOOST_TEST(i == 0);
+ BOOST_TEST(Holder<>::g_long == 3);
+ BOOST_TEST(g_str == "try: g_str");
+ } BOOST_SCOPE_EXIT_END
+
+ BOOST_SCOPE_EXIT( (&i) ) {
+ BOOST_TEST(i == 3);
+ BOOST_TEST(Holder<>::g_long == 3);
+ BOOST_TEST(g_str == "try: g_str");
     } BOOST_SCOPE_EXIT_END
 
     {
         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) )
- {
- try
- {
- i = 2;
- Holder<>::g_long = 2;
- throw 0;
- } catch(...) {}
+ BOOST_SCOPE_EXIT( (&i) ) {
+ try {
+ i = 2;
+ Holder<>::g_long = 2;
+ throw 0;
+ } catch(...) {}
         } BOOST_SCOPE_EXIT_END
 
- BOOST_CHECK(i == 0);
- BOOST_CHECK(g_str == "");
- BOOST_CHECK(Holder<>::g_long == 1);
+ BOOST_TEST(i == 0);
+ BOOST_TEST(g_str == "");
+ BOOST_TEST(Holder<>::g_long == 1);
     }
 
- BOOST_CHECK(Holder<>::g_long == 2);
- BOOST_CHECK(g_str == "g_str");
- BOOST_CHECK(i == 1); // Check that first declared is executed last
-
- BOOST_SCOPE_EXIT( (&i) )
- {
- BOOST_CHECK(i == 3);
- BOOST_CHECK(Holder<>::g_long == 3);
- BOOST_CHECK(g_str == "try: g_str");
+ BOOST_TEST(Holder<>::g_long == 2);
+ BOOST_TEST(g_str == "g_str");
+ BOOST_TEST(i == 1); // Check that first declared is executed last.
+
+ BOOST_SCOPE_EXIT( (&i) ) {
+ BOOST_TEST(i == 3);
+ BOOST_TEST(Holder<>::g_long == 3);
+ BOOST_TEST(g_str == "try: g_str");
     } BOOST_SCOPE_EXIT_END
 
- BOOST_SCOPE_EXIT( (i) )
- {
- BOOST_CHECK(i == 1);
- BOOST_CHECK(Holder<>::g_long == 3);
- BOOST_CHECK(g_str == "try: g_str");
+ BOOST_SCOPE_EXIT( (i) ) {
+ BOOST_TEST(i == 1);
+ BOOST_TEST(Holder<>::g_long == 3);
+ BOOST_TEST(g_str == "try: g_str");
     } BOOST_SCOPE_EXIT_END
 
- try
- {
- BOOST_SCOPE_EXIT( (&i) )
- {
+ try {
+ 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
 
- BOOST_CHECK(i == 1);
- BOOST_CHECK(g_str == "g_str");
- BOOST_CHECK(Holder<>::g_long == 2);
+ BOOST_TEST(i == 1);
+ BOOST_TEST(g_str == "g_str");
+ BOOST_TEST(Holder<>::g_long == 2);
 
         throw 0;
- }
- catch(int)
- {
- BOOST_CHECK(Holder<>::g_long == 3);
- BOOST_CHECK(g_str == "try: g_str");
- BOOST_CHECK(i == 3); // Check that first declared is executed last
+ } catch(int) {
+ BOOST_TEST(Holder<>::g_long == 3);
+ BOOST_TEST(g_str == "try: g_str");
+ BOOST_TEST(i == 3); // Check that first declared is executed last.
     }
 }
 
-bool foo()
-{
- return true;
-}
+bool foo(void) { return true; }
+
+bool foo2(void) { return false; }
 
-void test_types()
-{
- bool (*pf)() = 0;
- bool (&rf)() = foo;
+void test_types(void) {
+ bool (*pf)(void) = 0;
+ bool (&rf)(void) = foo;
     bool results[2] = {};
 
     {
- BOOST_SCOPE_EXIT( (&results)(&pf)(&rf) )
- {
+ BOOST_SCOPE_EXIT( (&results) (&pf) (&rf) ) {
             results[0] = pf();
             results[1] = rf();
         }
@@ -137,36 +123,72 @@
 
         pf = &foo;
 
- BOOST_CHECK(results[0] == false);
- BOOST_CHECK(results[1] == false);
+ BOOST_TEST(results[0] == false);
+ BOOST_TEST(results[1] == false);
     }
 
- BOOST_CHECK(results[0] == true);
- BOOST_CHECK(results[1] == true);
+ BOOST_TEST(results[0] == true);
+ BOOST_TEST(results[1] == true);
 
     {
- BOOST_SCOPE_EXIT( (&results)(pf) )
- {
+ BOOST_SCOPE_EXIT( (&results) (pf) ) {
             results[0] = !pf();
             results[1] = !pf();
+ pf = &foo2; // modify a copy
         }
         BOOST_SCOPE_EXIT_END
 
         pf = 0;
 
- BOOST_CHECK(results[0] == true);
- BOOST_CHECK(results[1] == true);
+ BOOST_TEST(results[0] == true);
+ BOOST_TEST(results[1] == true);
     }
 
- BOOST_CHECK(results[0] == false);
- BOOST_CHECK(results[1] == false);
+ BOOST_TEST(pf == 0);
+ BOOST_TEST(results[0] == false);
+ BOOST_TEST(results[1] == false);
+}
+
+void test_capture_all(void) {
+#ifndef BOOST_NO_LAMBDAS
+ int i = 0, j = 1;
+
+ {
+ BOOST_SCOPE_EXIT_ALL(=) {
+ i = j = 1; // modify copies
+ };
+ }
+ BOOST_TEST(i == 0);
+ BOOST_TEST(j == 1);
+
+ {
+ BOOST_SCOPE_EXIT_ALL(&) {
+ i = 1;
+ j = 2;
+ };
+ BOOST_TEST(i == 0);
+ BOOST_TEST(j == 1);
+ }
+ BOOST_TEST(i == 1);
+ BOOST_TEST(j == 2);
+
+ {
+ BOOST_SCOPE_EXIT_ALL(=, &j) {
+ i = 2; // modify a copy
+ j = 3;
+ };
+ BOOST_TEST(i == 1);
+ BOOST_TEST(j == 2);
+ }
+ BOOST_TEST(i == 1);
+ BOOST_TEST(j == 3);
+#endif // lambdas
 }
 
-test_suite* init_unit_test_suite( int, char* [] )
-{
- framework::master_test_suite().p_name.value = "Unit test for ScopeExit";
- framework::master_test_suite().add( BOOST_TEST_CASE( &test_non_local ));
- framework::master_test_suite().add( BOOST_TEST_CASE( &test_types ));
- return 0;
+int main(void) {
+ test_non_local();
+ test_types();
+ test_capture_all();
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/scope_exit/test/native_const_error.cpp
==============================================================================
--- branches/release/libs/scope_exit/test/native_const_error.cpp (original)
+++ branches/release/libs/scope_exit/test/native_const_error.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1,16 +1,16 @@
-// Copyright Alexander Nasonov 2007-2008
-//
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
+
+// Copyright (C) 2006-2009, 2012 Alexander Nasonov
+// Copyright (C) 2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
 // http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/scope_exit
 
 #include <boost/scope_exit.hpp>
 
-int main()
-{
+int main(void) {
     int const i = 0;
- BOOST_SCOPE_EXIT( (&i) )
- {
+ BOOST_SCOPE_EXIT( (&i) ) {
         i = 5;
     } BOOST_SCOPE_EXIT_END
 }

Modified: branches/release/libs/scope_exit/test/native_cv_error.cpp
==============================================================================
--- branches/release/libs/scope_exit/test/native_cv_error.cpp (original)
+++ branches/release/libs/scope_exit/test/native_cv_error.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1,21 +1,19 @@
-// Copyright Alexander Nasonov 2007-2008
-//
-// 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)
 
-#include <string>
+// Copyright (C) 2006-2009, 2012 Alexander Nasonov
+// Copyright (C) 2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/scope_exit
 
 #include <boost/scope_exit.hpp>
-
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/string.hpp>
+#include <string>
 
-int main()
-{
+int main(void) {
     std::string const volatile s;
- BOOST_SCOPE_EXIT( (&s) )
- {
+ BOOST_SCOPE_EXIT( (&s) ) {
         s = "";
     } BOOST_SCOPE_EXIT_END
 }

Copied: branches/release/libs/scope_exit/test/native_this.cpp (from r77042, /trunk/libs/scope_exit/test/native_this.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/native_this.cpp (original)
+++ branches/release/libs/scope_exit/test/native_this.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,37 +7,37 @@
 // Home at http://www.boost.org/libs/scope_exit
 
 #include <boost/scope_exit.hpp>
+#include <boost/config.hpp>
 #include <boost/typeof/typeof.hpp>
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#include <boost/test/unit_test.hpp>
-
-using namespace boost::unit_test;
+#include <boost/detail/lightweight_test.hpp>
 
 struct this_tester;
-BOOST_TYPEOF_REGISTER_TYPE(this_tester) // Register before capture of `this_`.
+BOOST_TYPEOF_REGISTER_TYPE(this_tester) // Register before `this_` capture.
 
 struct this_tester {
     void check(void) {
- int target;
- BOOST_SCOPE_EXIT(&target, this_) {
- BOOST_CHECK( this_->value_ == target );
+ value_ = -1;
+
+ BOOST_SCOPE_EXIT( (this_) ) {
+ BOOST_TEST(this_->value_ == 0);
         } BOOST_SCOPE_EXIT_END
-#if !defined(BOOST_NO_LAMBDAS) && !defined(BOOST_SCOPE_EXIT_CONFIG_NO_CPP11)
+
+#ifndef BOOST_NO_LAMBDAS
         BOOST_SCOPE_EXIT_ALL(&, this) {
- BOOST_CHECK( this->value_ == target );
+ BOOST_TEST(this->value_ == 0);
         };
-#endif
- value_ = target = 3;
+#endif // lambdas
+
+ value_ = 0;
     }
+
 private:
     int value_;
 };
 
-void test_this(void) { this_tester().check(); }
-
-test_suite* init_unit_test_suite(int, char* []) {
- framework::master_test_suite().p_name.value = "Unit test for ScopeExit";
- framework::master_test_suite().add(BOOST_TEST_CASE(&test_this));
- return 0;
+int main(void) {
+ this_tester().check();
+ return boost::report_errors();
 }
 

Copied: branches/release/libs/scope_exit/test/native_this_tpl.cpp (from r77411, /trunk/libs/scope_exit/test/native_this_tpl.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/native_this_tpl.cpp (original)
+++ branches/release/libs/scope_exit/test/native_this_tpl.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,11 +7,10 @@
 // Home at http://www.boost.org/libs/scope_exit
 
 #include <boost/scope_exit.hpp>
+#include <boost/config.hpp>
 #include <boost/typeof/typeof.hpp>
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#include <boost/test/unit_test.hpp>
-
-using namespace boost::unit_test;
+#include <boost/detail/lightweight_test.hpp>
 
 template<typename T>
 struct this_tester;
@@ -23,14 +22,14 @@
         value_ = -1;
 
         BOOST_SCOPE_EXIT_TPL( (this_) ) {
- BOOST_CHECK(this_->value_ == 0);
+ BOOST_TEST(this_->value_ == 0);
         } BOOST_SCOPE_EXIT_END
 
-#if !defined(BOOST_NO_LAMBDAS) && !defined(BOOST_SCOPE_EXIT_CONFIG_NO_CPP11)
+#ifndef BOOST_NO_LAMBDAS
         BOOST_SCOPE_EXIT_ALL(&, this) {
- BOOST_CHECK(this->value_ == 0);
+ BOOST_TEST(this->value_ == 0);
         };
-#endif
+#endif // lambdas
 
         value_ = 0;
     }
@@ -39,11 +38,8 @@
     T value_;
 };
 
-void test_this_tpl(void) { this_tester<int>().check(); }
-
-test_suite* init_unit_test_suite(int, char* []) {
- framework::master_test_suite().p_name.value = "Unit test for ScopeExit";
- framework::master_test_suite().add(BOOST_TEST_CASE(&test_this_tpl));
- return 0;
+int main(void) {
+ this_tester<int>().check();
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/scope_exit/test/native_tpl.cpp
==============================================================================
--- branches/release/libs/scope_exit/test/native_tpl.cpp (original)
+++ branches/release/libs/scope_exit/test/native_tpl.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1,87 +1,73 @@
-// Copyright Alexander Nasonov 2007-2008
-//
-// 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)
 
-#include <iostream>
-#include <ostream>
-#include <vector>
+// Copyright (C) 2006-2009, 2012 Alexander Nasonov
+// Copyright (C) 2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/scope_exit
 
 #include <boost/scope_exit.hpp>
-
 #include <boost/rational.hpp>
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/vector.hpp>
-#include <boost/test/unit_test.hpp>
-
-using namespace boost::unit_test;
+#include <boost/detail/lightweight_test.hpp>
+#include <vector>
 
 template<class type>
-void tpl_long( type tval
- , type& t
- , type const& tc
- , type volatile& tv
- , type const volatile& tcv
- )
-{
+void tpl_long(
+ type tval
+ , type & t
+ , type const& tc
+ , type volatile& tv
+ , type const volatile& tcv
+) {
     int i = 0; // non-dependent name
     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;
- }
- BOOST_SCOPE_EXIT_END
+ } BOOST_SCOPE_EXIT_END
 
- BOOST_CHECK(t == remember);
- BOOST_CHECK(tval == remember);
+ BOOST_TEST(t == remember);
+ BOOST_TEST(tval == remember);
     }
 
- BOOST_CHECK(tval == 1);
- BOOST_CHECK(t == remember + 2);
+ BOOST_TEST(tval == 1);
+ BOOST_TEST(t == remember + 2);
 }
 
 template<class Vector, int Value>
-void tpl_vector( Vector vval
- , Vector& v
- , Vector const& vc
- )
-{
+void tpl_vector(
+ Vector vval
+ , Vector & v
+ , Vector const& vc
+) {
     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
+ } BOOST_SCOPE_EXIT_END
 
- BOOST_CHECK(v.size() == remember.size());
- BOOST_CHECK(vval.size() == remember.size());
+ BOOST_TEST(v.size() == remember.size());
+ BOOST_TEST(vval.size() == remember.size());
     }
 
- BOOST_CHECK(v.size() == 1 + remember.size());
- BOOST_CHECK(vval.size() == 1 + remember.size());
+ BOOST_TEST(v.size() == 1 + remember.size());
+ BOOST_TEST(vval.size() == 1 + remember.size());
 }
 
-void test_tpl()
-{
+int main(void) {
     long l = 137;
     tpl_long(l, l, l, l, l);
 
     std::vector<int> v(10, 137);
     tpl_vector<std::vector<int>, 13>(v, v, v);
-}
 
-test_suite* init_unit_test_suite( int, char* [] )
-{
- framework::master_test_suite().p_name.value = "Unit test for ScopeExit TPL";
- framework::master_test_suite().add( BOOST_TEST_CASE( &test_tpl ));
- return 0;
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/scope_exit/test/native_tu1.cpp
==============================================================================
--- branches/release/libs/scope_exit/test/native_tu1.cpp (original)
+++ branches/release/libs/scope_exit/test/native_tu1.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1,13 +1,12 @@
-// Copyright Alexander Nasonov 2007-2008
-//
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
+
+// Copyright (C) 2006-2009, 2012 Alexander Nasonov
+// Copyright (C) 2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
 // http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/scope_exit
 
 #include "tu_test.hpp"
 
-int tu1()
-{
- return inline_f() + template_f(1);
-}
+int tu1(void) { return inline_f() + template_f(1); }
 

Modified: branches/release/libs/scope_exit/test/native_tu2.cpp
==============================================================================
--- branches/release/libs/scope_exit/test/native_tu2.cpp (original)
+++ branches/release/libs/scope_exit/test/native_tu2.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1,13 +1,12 @@
-// Copyright Alexander Nasonov 2007-2008
-//
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
+
+// Copyright (C) 2006-2009, 2012 Alexander Nasonov
+// Copyright (C) 2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
 // http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/scope_exit
 
 #include "tu_test.hpp"
 
-int tu2()
-{
- return inline_f() + template_f(2);
-}
+int tu2(void) { return inline_f() + template_f(2); }
 

Modified: branches/release/libs/scope_exit/test/native_tu_test.cpp
==============================================================================
--- branches/release/libs/scope_exit/test/native_tu_test.cpp (original)
+++ branches/release/libs/scope_exit/test/native_tu_test.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1,24 +1,21 @@
-// Copyright Alexander Nasonov 2007-2008
-//
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
+
+// Copyright (C) 2006-2009, 2012 Alexander Nasonov
+// Copyright (C) 2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
 // http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/scope_exit
 
 #include "tu_test.hpp"
+#include <boost/detail/lightweight_test.hpp>
 
-#include <boost/test/unit_test.hpp>
-
-using namespace boost::unit_test;
-
-void test()
-{
- BOOST_CHECK(tu1() == 1);
- BOOST_CHECK(tu2() == 2);
+void test(void) {
+ BOOST_TEST(tu1() == 1);
+ BOOST_TEST(tu2() == 2);
 }
 
-test_suite* init_unit_test_suite( int, char* [] )
-{
- framework::master_test_suite().p_name.value = "TU unit test for ScopeExit";
- framework::master_test_suite().add( BOOST_TEST_CASE( &test ));
- return 0;
+int main(void) {
+ test();
+ return boost::report_errors();
 }
+

Copied: branches/release/libs/scope_exit/test/same_line.cpp (from r77411, /trunk/libs/scope_exit/test/same_line.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/same_line.cpp (original)
+++ branches/release/libs/scope_exit/test/same_line.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,57 +7,73 @@
 // Home at http://www.boost.org/libs/scope_exit
 
 #include <boost/config.hpp>
-#ifndef BOOST_NO_VARIADIC_MACROS
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
 
 #include <boost/scope_exit.hpp>
 #include <boost/preprocessor/cat.hpp>
-#define BOOST_TEST_MODULE TestSameLine
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
 //[same_line
 #define SCOPE_EXIT_INC_DEC(variable, offset) \
- BOOST_SCOPE_EXIT_ID( \
- BOOST_PP_CAT(inc, __LINE__) /* unique ID */, 0 /* no TPL */, \
+ BOOST_SCOPE_EXIT_ID(BOOST_PP_CAT(inc, __LINE__), /* unique ID */ \
             &variable, offset) { \
         variable += offset; \
     } BOOST_SCOPE_EXIT_END_ID(BOOST_PP_CAT(inc, __LINE__)) \
     \
- BOOST_SCOPE_EXIT_ID( \
- BOOST_PP_CAT(dec, __LINE__) /* unique ID */, 0 /* no TPL */, \
+ BOOST_SCOPE_EXIT_ID(BOOST_PP_CAT(dec, __LINE__), \
+ &variable, offset) { \
+ variable -= offset; \
+ } BOOST_SCOPE_EXIT_END_ID(BOOST_PP_CAT(dec, __LINE__))
+
+#define SCOPE_EXIT_INC_DEC_TPL(variable, offset) \
+ BOOST_SCOPE_EXIT_ID_TPL(BOOST_PP_CAT(inc, __LINE__), \
+ &variable, offset) { \
+ variable += offset; \
+ } BOOST_SCOPE_EXIT_END_ID(BOOST_PP_CAT(inc, __LINE__)) \
+ \
+ BOOST_SCOPE_EXIT_ID_TPL(BOOST_PP_CAT(dec, __LINE__), \
             &variable, offset) { \
         variable -= offset; \
     } BOOST_SCOPE_EXIT_END_ID(BOOST_PP_CAT(dec, __LINE__))
 
 #define SCOPE_EXIT_ALL_INC_DEC(variable, offset) \
- BOOST_SCOPE_EXIT_ALL_ID(BOOST_PP_CAT(inc, __LINE__) /* unique ID */, \
+ BOOST_SCOPE_EXIT_ALL_ID(BOOST_PP_CAT(inc, __LINE__), \
             =, &variable) { \
         variable += offset; \
     }; \
- BOOST_SCOPE_EXIT_ALL_ID(BOOST_PP_CAT(dec, __LINE__) /* unique ID */, \
+ BOOST_SCOPE_EXIT_ALL_ID(BOOST_PP_CAT(dec, __LINE__), \
             =, &variable) { \
         variable -= offset; \
     };
 
-BOOST_AUTO_TEST_CASE(test_same_line) {
+template<typename T>
+void f(T& x, T& delta) {
+ SCOPE_EXIT_INC_DEC_TPL(x, delta) // Multiple scope exits on same line.
+ BOOST_TEST(x == 0);
+}
+
+int main(void) {
     int x = 0, delta = 10;
 
     {
- SCOPE_EXIT_INC_DEC(x, delta)
+ SCOPE_EXIT_INC_DEC(x, delta) // Multiple scope exits on same line.
     }
- BOOST_CHECK(x == 0);
+ BOOST_TEST(x == 0);
+
+ f(x, delta);
 
 #ifndef BOOST_NO_LAMBDAS
     {
- SCOPE_EXIT_ALL_INC_DEC(x, delta)
+ SCOPE_EXIT_ALL_INC_DEC(x, delta) // Multiple scope exits on same line.
     }
- BOOST_CHECK(x == 0);
-#endif
+ BOOST_TEST(x == 0);
+#endif // LAMBDAS
+
+ return boost::report_errors();
 }
 //]
 
-#else
-
-int main(void) { return 0; } // Trivial test.
-
-#endif
+#endif // variadic macros
 

Copied: branches/release/libs/scope_exit/test/same_line_seq.cpp (from r77411, /trunk/libs/scope_exit/test/same_line_seq.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/same_line_seq.cpp (original)
+++ branches/release/libs/scope_exit/test/same_line_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -9,45 +9,63 @@
 #include <boost/scope_exit.hpp>
 #include <boost/preprocessor/cat.hpp>
 #include <boost/config.hpp>
-#define BOOST_TEST_MODULE TestSameLineSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
 #define SCOPE_EXIT_INC_DEC(variable, offset) \
- BOOST_SCOPE_EXIT_ID( \
- BOOST_PP_CAT(inc, __LINE__) /* unique ID */, 0 /* no TPL */, \
+ BOOST_SCOPE_EXIT_ID(BOOST_PP_CAT(inc, __LINE__), /* unique ID */ \
             (&variable) (offset) ) { \
         variable += offset; \
     } BOOST_SCOPE_EXIT_END_ID(BOOST_PP_CAT(inc, __LINE__)) \
     \
- BOOST_SCOPE_EXIT_ID( \
- BOOST_PP_CAT(dec, __LINE__) /* unique ID */, 0 /* no TPL */, \
+ BOOST_SCOPE_EXIT_ID(BOOST_PP_CAT(dec, __LINE__), \
+ (&variable) (offset) ) { \
+ variable -= offset; \
+ } BOOST_SCOPE_EXIT_END_ID(BOOST_PP_CAT(dec, __LINE__))
+
+#define SCOPE_EXIT_INC_DEC_TPL(variable, offset) \
+ BOOST_SCOPE_EXIT_ID_TPL(BOOST_PP_CAT(inc, __LINE__), \
+ (&variable) (offset) ) { \
+ variable += offset; \
+ } BOOST_SCOPE_EXIT_END_ID(BOOST_PP_CAT(inc, __LINE__)) \
+ \
+ BOOST_SCOPE_EXIT_ID_TPL(BOOST_PP_CAT(dec, __LINE__), \
             (&variable) (offset) ) { \
         variable -= offset; \
     } BOOST_SCOPE_EXIT_END_ID(BOOST_PP_CAT(dec, __LINE__))
 
 #define SCOPE_EXIT_ALL_INC_DEC(variable, offset) \
- BOOST_SCOPE_EXIT_ALL_ID(BOOST_PP_CAT(inc, __LINE__) /* unique ID */, \
+ BOOST_SCOPE_EXIT_ALL_ID(BOOST_PP_CAT(inc, __LINE__), \
             (=) (&variable) ) { \
         variable += offset; \
     }; \
- BOOST_SCOPE_EXIT_ALL_ID(BOOST_PP_CAT(dec, __LINE__) /* unique ID */, \
+ BOOST_SCOPE_EXIT_ALL_ID(BOOST_PP_CAT(dec, __LINE__), \
             (=) (&variable) ) { \
         variable -= offset; \
     };
 
-BOOST_AUTO_TEST_CASE(test_same_line_seq) {
+template<typename T>
+void f(T& x, T& delta) {
+ SCOPE_EXIT_INC_DEC_TPL(x, delta)
+ BOOST_TEST(x == 0);
+}
+
+int main(void) {
     int x = 0, delta = 10;
 
     {
         SCOPE_EXIT_INC_DEC(x, delta)
     }
- BOOST_CHECK(x == 0);
+ BOOST_TEST(x == 0);
+
+ f(x, delta);
 
 #ifndef BOOST_NO_LAMBDAS
     {
         SCOPE_EXIT_ALL_INC_DEC(x, delta)
     }
- BOOST_CHECK(x == 0);
-#endif
+ BOOST_TEST(x == 0);
+#endif // LAMBDAS
+
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/scope_exit/test/tu_test.hpp
==============================================================================
--- branches/release/libs/scope_exit/test/tu_test.hpp (original)
+++ branches/release/libs/scope_exit/test/tu_test.hpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1,39 +1,46 @@
-// Copyright Alexander Nasonov 2007-2008
-//
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
+
+// Copyright (C) 2006-2009, 2012 Alexander Nasonov
+// Copyright (C) 2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
 // http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/scope_exit
+
+// No #include guard for this header.
 
 #include <boost/scope_exit.hpp>
+#include <boost/config.hpp>
 
-int tu1();
-int tu2();
+int tu1(void);
+int tu2(void);
 
-inline int inline_f()
-{
+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;
 }
 
-#if !defined(BOOST_SCOPE_EXIT_AUX_GCC)
-#error "BOOST_SCOPE_EXIT_AUX_GCC undefined!"
-#elif BOOST_SCOPE_EXIT_AUX_GCC == 0 || BOOST_SCOPE_EXIT_AUX_GCC >= 304
+#if !defined(BOOST_INTEL) && defined(__GNUC__) && \
+ (__GNUC__ * 100 + __GNUC_MINOR__) >= 304
 template<class Int>
-Int template_f(Int i)
-{
+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)
-{
+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;
 }

Copied: branches/release/libs/scope_exit/test/world.cpp (from r77042, /trunk/libs/scope_exit/test/world.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/world.cpp (original)
+++ branches/release/libs/scope_exit/test/world.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,22 +6,29 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/scope_exit
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/scope_exit.hpp>
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/vector.hpp>
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorld
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 
-struct person; BOOST_TYPEOF_REGISTER_TYPE(person)
 struct person {};
+BOOST_TYPEOF_REGISTER_TYPE(person)
 
-struct world; BOOST_TYPEOF_REGISTER_TYPE(world)
 struct world {
     void add_person(person const& a_person);
+ size_t population(void) const { return persons_.size(); }
+
+private:
     std::vector<person> persons_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(world)
 
 //[world
 void world::add_person(person const& a_person) {
@@ -39,10 +46,13 @@
 }
 //]
 
-BOOST_AUTO_TEST_CASE( test_world ) {
+int main(void) {
     world w;
     person p;
     w.add_person(p);
- BOOST_CHECK( w.persons_.size() == 1 );
+ BOOST_TEST(w.population() == 1);
+ return boost::report_errors();
 }
 
+#endif // variadic macros
+

Copied: branches/release/libs/scope_exit/test/world_checkpoint.cpp (from r77042, /trunk/libs/scope_exit/test/world_checkpoint.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/world_checkpoint.cpp (original)
+++ branches/release/libs/scope_exit/test/world_checkpoint.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,41 +6,38 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/scope_exit
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/scope_exit.hpp>
 #include <boost/foreach.hpp>
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/vector.hpp>
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldCheckpoint
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 #include <iostream>
 #include <sstream>
 
-class person; BOOST_TYPEOF_REGISTER_TYPE(person)
-class person {
- friend class world;
-public:
+struct person {
     typedef unsigned int id_t;
     typedef unsigned int evolution_t;
+
+ id_t id;
+ evolution_t evolution;
 
- person(void) : id_(0), evolution_(0) {}
+ person(void) : id(0), evolution(0) {}
 
     friend std::ostream& operator<<(std::ostream& o, person const& p) {
- return o << "person(" << p.id_ << ", " << p.evolution_ << ")";
+ return o << "person(" << p.id << ", " << p.evolution << ")";
     }
-private:
- id_t id_;
- evolution_t evolution_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(person)
 
-class world; BOOST_TYPEOF_REGISTER_TYPE(world)
-class world {
-public:
- typedef unsigned int id_t;
-
+struct world {
     world(void) : next_id_(1) {}
-
     void add_person(person const& a_person);
 
     friend std::ostream& operator<<(std::ostream& o, world const& w) {
@@ -50,10 +47,12 @@
         }
         return o << "})";
     }
+
 private:
- id_t next_id_;
+ person::id_t next_id_;
     std::vector<person> persons_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(world)
 
 //[world_checkpoint
 void world::add_person(person const& a_person) {
@@ -61,42 +60,42 @@
 
     // This block must be no-throw.
     person& p = persons_.back();
- person::evolution_t checkpoint = p.evolution_;
+ person::evolution_t checkpoint = p.evolution;
     BOOST_SCOPE_EXIT(checkpoint, &p, &persons_) {
- if(checkpoint == p.evolution_) persons_.pop_back();
+ if(checkpoint == p.evolution) persons_.pop_back();
     } BOOST_SCOPE_EXIT_END
 
     // ...
 
- checkpoint = ++p.evolution_;
+ checkpoint = ++p.evolution;
 
     // Assign new identifier to the person.
- world::id_t const prev_id = p.id_;
- p.id_ = next_id_++;
+ person::id_t const prev_id = p.id;
+ p.id = next_id_++;
     BOOST_SCOPE_EXIT(checkpoint, &p, &next_id_, prev_id) {
- if(checkpoint == p.evolution_) {
- next_id_ = p.id_;
- p.id_ = prev_id;
+ if(checkpoint == p.evolution) {
+ next_id_ = p.id;
+ p.id = prev_id;
         }
     } BOOST_SCOPE_EXIT_END
 
     // ...
 
- checkpoint = ++p.evolution_;
+ checkpoint = ++p.evolution;
 }
 //]
 
-BOOST_AUTO_TEST_CASE( test_world_checkpoint ) {
+int main(void) {
     person adam, eva;
     std::ostringstream oss;
     oss << adam;
     std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "person(0, 0)" );
+ BOOST_TEST(oss.str() == "person(0, 0)");
 
     oss.str("");
     oss << eva;
     std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "person(0, 0)" );
+ BOOST_TEST(oss.str() == "person(0, 0)");
 
     world w;
     w.add_person(adam);
@@ -104,6 +103,10 @@
     oss.str("");
     oss << w;
     std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "world(3, { person(1, 2), person(2, 2), })" );
+ BOOST_TEST(oss.str() == "world(3, { person(1, 2), person(2, 2), })");
+
+ return boost::report_errors();
 }
 
+#endif // variadic macros
+

Copied: branches/release/libs/scope_exit/test/world_checkpoint_all.cpp (from r77042, /trunk/libs/scope_exit/test/world_checkpoint_all.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/world_checkpoint_all.cpp (original)
+++ branches/release/libs/scope_exit/test/world_checkpoint_all.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,43 +7,39 @@
 // Home at http://www.boost.org/libs/scope_exit
 
 #include <boost/config.hpp>
-#ifndef BOOST_NO_LAMBDAS
+#if defined(BOOST_NO_LAMBDAS)
+# error "lambda functions required"
+#elif defined(BOOST_NO_VARIADIC_MACROS)
+# error "variadic macros required"
+#else
 
 #include <boost/scope_exit.hpp>
 #include <boost/foreach.hpp>
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/vector.hpp>
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldCheckpointAll
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 #include <iostream>
 #include <sstream>
 
-class person; BOOST_TYPEOF_REGISTER_TYPE(person)
-class person {
- friend class world;
-public:
+struct person {
     typedef unsigned int id_t;
     typedef unsigned int evolution_t;
+
+ id_t id;
+ evolution_t evolution;
 
- person(void) : id_(0), evolution_(0) {}
+ person(void) : id(0), evolution(0) {}
 
     friend std::ostream& operator<<(std::ostream& o, person const& p) {
- return o << "person(" << p.id_ << ", " << p.evolution_ << ")";
+ return o << "person(" << p.id << ", " << p.evolution << ")";
     }
-private:
- id_t id_;
- evolution_t evolution_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(person)
 
-class world; BOOST_TYPEOF_REGISTER_TYPE(world)
-class world {
-public:
- typedef unsigned int id_t;
-
+struct world {
     world(void) : next_id_(1) {}
-
     void add_person(person const& a_person);
 
     friend std::ostream& operator<<(std::ostream& o, world const& w) {
@@ -53,10 +49,12 @@
         }
         return o << "})";
     }
+
 private:
- id_t next_id_;
+ person::id_t next_id_;
     std::vector<person> persons_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(world)
 
 //[world_checkpoint_all
 void world::add_person(person const& a_person) {
@@ -64,42 +62,44 @@
 
     // This block must be no-throw.
     person& p = persons_.back();
- person::evolution_t checkpoint = p.evolution_;
- BOOST_SCOPE_EXIT_ALL(&, checkpoint, this_) { // Capture all by ref (C++11).
- if(checkpoint == p.evolution_) this_->persons_.pop_back();
- } BOOST_SCOPE_EXIT_END
+ person::evolution_t checkpoint = p.evolution;
+ // Capture all by reference `&`, but `checkpoint` and `this` (C++11 only).
+ BOOST_SCOPE_EXIT_ALL(&, checkpoint, this) { // Use `this` (not `this_`).
+ if(checkpoint == p.evolution) this->persons_.pop_back();
+ }; // Use `;` (not `SCOPE_EXIT_END`).
 
     // ...
 
- checkpoint = ++p.evolution_;
+ checkpoint = ++p.evolution;
 
     // Assign new identifier to the person.
- world::id_t const prev_id = p.id_;
- p.id_ = next_id_++;
- BOOST_SCOPE_EXIT_ALL(=, &p, this) { // Capture all by value, `this` (C++11).
- if(checkpoint == p.evolution_) {
- this->next_id_ = p.id_;
- p.id_ = prev_id;
+ person::id_t const prev_id = p.id;
+ p.id = next_id_++;
+ // Capture all by value `=`, but `p` (C++11 only).
+ BOOST_SCOPE_EXIT_ALL(=, &p) {
+ if(checkpoint == p.evolution) {
+ this->next_id_ = p.id;
+ p.id = prev_id;
         }
- }; // Use `;` instead of `SCOPE_EXIT_END` (C++11).
+ };
 
     // ...
 
- checkpoint = ++p.evolution_;
+ checkpoint = ++p.evolution;
 }
 //]
 
-BOOST_AUTO_TEST_CASE( test_world_checkpoint_all ) {
+int main(void) {
     person adam, eva;
     std::ostringstream oss;
     oss << adam;
     std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "person(0, 0)" );
+ BOOST_TEST(oss.str() == "person(0, 0)");
 
     oss.str("");
     oss << eva;
     std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "person(0, 0)" );
+ BOOST_TEST(oss.str() == "person(0, 0)");
 
     world w;
     w.add_person(adam);
@@ -107,12 +107,10 @@
     oss.str("");
     oss << w;
     std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "world(3, { person(1, 2), person(2, 2), })" );
-}
+ BOOST_TEST(oss.str() == "world(3, { person(1, 2), person(2, 2), })");
 
-#else // No lambdas (trivial test).
-
-int main(void) { return 0; }
+ return boost::report_errors();
+}
 
-#endif
+#endif // lambda functions and variadic macros
 

Copied: branches/release/libs/scope_exit/test/world_checkpoint_all_seq.cpp (from r77042, /trunk/libs/scope_exit/test/world_checkpoint_all_seq.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/world_checkpoint_all_seq.cpp (original)
+++ branches/release/libs/scope_exit/test/world_checkpoint_all_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,43 +7,37 @@
 // Home at http://www.boost.org/libs/scope_exit
 
 #include <boost/config.hpp>
-#ifndef BOOST_NO_LAMBDAS
+#ifdef BOOST_NO_LAMBDAS
+# error "lambda functions required"
+#else
 
 #include <boost/scope_exit.hpp>
 #include <boost/foreach.hpp>
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/vector.hpp>
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldCheckpointAllSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 #include <iostream>
 #include <sstream>
 
-class person; BOOST_TYPEOF_REGISTER_TYPE(person)
-class person {
- friend class world;
-public:
+struct person {
     typedef unsigned int id_t;
     typedef unsigned int evolution_t;
+
+ id_t id;
+ evolution_t evolution;
 
- person(void) : id_(0), evolution_(0) {}
+ person(void) : id(0), evolution(0) {}
 
     friend std::ostream& operator<<(std::ostream& o, person const& p) {
- return o << "person(" << p.id_ << ", " << p.evolution_ << ")";
+ return o << "person(" << p.id << ", " << p.evolution << ")";
     }
-private:
- id_t id_;
- evolution_t evolution_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(person)
 
-class world; BOOST_TYPEOF_REGISTER_TYPE(world)
-class world {
-public:
- typedef unsigned int id_t;
-
+struct world {
     world(void) : next_id_(1) {}
-
     void add_person(person const& a_person);
 
     friend std::ostream& operator<<(std::ostream& o, world const& w) {
@@ -53,53 +47,53 @@
         }
         return o << "})";
     }
+
 private:
- id_t next_id_;
+ person::id_t next_id_;
     std::vector<person> persons_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(world)
 
-//[world_checkpoint_all_seq
 void world::add_person(person const& a_person) {
     persons_.push_back(a_person);
 
     // This block must be no-throw.
     person& p = persons_.back();
- person::evolution_t checkpoint = p.evolution_;
- BOOST_SCOPE_EXIT_ALL( (&) (checkpoint) (this_) ) {
- if(checkpoint == p.evolution_) this_->persons_.pop_back();
- } BOOST_SCOPE_EXIT_END
+ person::evolution_t checkpoint = p.evolution;
+ BOOST_SCOPE_EXIT_ALL( (&) (checkpoint) (this) ) {
+ if(checkpoint == p.evolution) this->persons_.pop_back();
+ };
 
     // ...
 
- checkpoint = ++p.evolution_;
+ checkpoint = ++p.evolution;
 
     // Assign new identifier to the person.
- world::id_t const prev_id = p.id_;
- p.id_ = next_id_++;
- BOOST_SCOPE_EXIT_ALL( (=) (&p) (this) ) {
- if(checkpoint == p.evolution_) {
- this->next_id_ = p.id_;
- p.id_ = prev_id;
+ person::id_t const prev_id = p.id;
+ p.id = next_id_++;
+ BOOST_SCOPE_EXIT_ALL( (=) (&p) ) {
+ if(checkpoint == p.evolution) {
+ this->next_id_ = p.id;
+ p.id = prev_id;
         }
     };
 
     // ...
 
- checkpoint = ++p.evolution_;
+ checkpoint = ++p.evolution;
 }
-//]
 
-BOOST_AUTO_TEST_CASE( test_world_checkpoint_all_seq ) {
+int main(void) {
     person adam, eva;
     std::ostringstream oss;
     oss << adam;
     std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "person(0, 0)" );
+ BOOST_TEST(oss.str() == "person(0, 0)");
 
     oss.str("");
     oss << eva;
     std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "person(0, 0)" );
+ BOOST_TEST(oss.str() == "person(0, 0)");
 
     world w;
     w.add_person(adam);
@@ -107,12 +101,10 @@
     oss.str("");
     oss << w;
     std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "world(3, { person(1, 2), person(2, 2), })" );
-}
+ BOOST_TEST(oss.str() == "world(3, { person(1, 2), person(2, 2), })");
 
-#else // No lambdas (trivial test).
-
-int main(void) { return 0; }
+ return boost::report_errors();
+}
 
-#endif
+#endif // variadic macros
 

Copied: branches/release/libs/scope_exit/test/world_checkpoint_seq.cpp (from r77042, /trunk/libs/scope_exit/test/world_checkpoint_seq.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/world_checkpoint_seq.cpp (original)
+++ branches/release/libs/scope_exit/test/world_checkpoint_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -11,36 +11,27 @@
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/vector.hpp>
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldCheckpointSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
-#include <iostream>
 #include <sstream>
 
-class person; BOOST_TYPEOF_REGISTER_TYPE(person)
-class person {
- friend class world;
-public:
+struct person {
     typedef unsigned int id_t;
     typedef unsigned int evolution_t;
+
+ id_t id;
+ evolution_t evolution;
 
- person(void) : id_(0), evolution_(0) {}
+ person(void) : id(0), evolution(0) {}
 
     friend std::ostream& operator<<(std::ostream& o, person const& p) {
- return o << "person(" << p.id_ << ", " << p.evolution_ << ")";
+ return o << "person(" << p.id << ", " << p.evolution << ")";
     }
-private:
- id_t id_;
- evolution_t evolution_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(person)
 
-class world; BOOST_TYPEOF_REGISTER_TYPE(world)
-class world {
-public:
- typedef unsigned int id_t;
-
+struct world {
     world(void) : next_id_(1) {}
-
     void add_person(person const& a_person);
 
     friend std::ostream& operator<<(std::ostream& o, world const& w) {
@@ -50,60 +41,59 @@
         }
         return o << "})";
     }
+
 private:
- id_t next_id_;
+ person::id_t next_id_;
     std::vector<person> persons_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(world)
 
-//[world_checkpoint_seq
 void world::add_person(person const& a_person) {
     persons_.push_back(a_person);
 
     // This block must be no-throw.
     person& p = persons_.back();
- person::evolution_t checkpoint = p.evolution_;
- BOOST_SCOPE_EXIT( (checkpoint) (&p) (&persons_) ) { // Sequence, not commas.
- if(checkpoint == p.evolution_) persons_.pop_back();
+ person::evolution_t checkpoint = p.evolution;
+ BOOST_SCOPE_EXIT( (checkpoint) (&p) (&persons_) ) {
+ if(checkpoint == p.evolution) persons_.pop_back();
     } BOOST_SCOPE_EXIT_END
 
     // ...
 
- checkpoint = ++p.evolution_;
+ checkpoint = ++p.evolution;
 
     // Assign new identifier to the person.
- world::id_t const prev_id = p.id_;
- p.id_ = next_id_++;
+ person::id_t const prev_id = p.id;
+ p.id = next_id_++;
     BOOST_SCOPE_EXIT( (checkpoint) (&p) (&next_id_) (prev_id) ) {
- if(checkpoint == p.evolution_) {
- next_id_ = p.id_;
- p.id_ = prev_id;
+ if(checkpoint == p.evolution) {
+ next_id_ = p.id;
+ p.id = prev_id;
         }
     } BOOST_SCOPE_EXIT_END
 
     // ...
 
- checkpoint = ++p.evolution_;
+ checkpoint = ++p.evolution;
 }
-//]
 
-BOOST_AUTO_TEST_CASE( test_world_checkpoint_seq ) {
+int main(void) {
     person adam, eva;
     std::ostringstream oss;
     oss << adam;
- std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "person(0, 0)" );
+ BOOST_TEST(oss.str() == "person(0, 0)");
 
     oss.str("");
     oss << eva;
- std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "person(0, 0)" );
+ BOOST_TEST(oss.str() == "person(0, 0)");
 
     world w;
     w.add_person(adam);
     w.add_person(eva);
     oss.str("");
     oss << w;
- std::cout << oss.str() << std::endl;
- BOOST_CHECK( oss.str() == "world(3, { person(1, 2), person(2, 2), })" );
+ BOOST_TEST(oss.str() == "world(3, { person(1, 2), person(2, 2), })");
+
+ return boost::report_errors();
 }
 

Copied: branches/release/libs/scope_exit/test/world_seq.cpp (from r77042, /trunk/libs/scope_exit/test/world_seq.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/world_seq.cpp (original)
+++ branches/release/libs/scope_exit/test/world_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -10,38 +10,42 @@
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/vector.hpp>
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 
-struct person; BOOST_TYPEOF_REGISTER_TYPE(person)
 struct person {};
+BOOST_TYPEOF_REGISTER_TYPE(person)
 
-struct world; BOOST_TYPEOF_REGISTER_TYPE(world)
 struct world {
     void add_person(person const& a_person);
+ size_t population(void) const { return persons_.size(); }
+
+private:
     std::vector<person> persons_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(world)
 
 //[world_seq
 void world::add_person(person const& a_person) {
     bool commit = false;
 
- persons_.push_back(a_person);
+ persons_.push_back(a_person); // (1) direct action
+ // Following block is executed when the enclosing scope exits.
     BOOST_SCOPE_EXIT( (&commit) (&persons_) ) {
- if(!commit) persons_.pop_back();
+ if(!commit) persons_.pop_back(); // (2) rollback action
     } BOOST_SCOPE_EXIT_END
 
- // ...
+ // ... // (3) other operations
 
- commit = true;
+ commit = true; // (4) disable rollback actions
 }
 //]
 
-BOOST_AUTO_TEST_CASE( test_world_seq ) {
+int main(void) {
     world w;
     person p;
     w.add_person(p);
- BOOST_CHECK( w.persons_.size() == 1 );
+ BOOST_TEST(w.population() == 1);
+ return boost::report_errors();
 }
 

Copied: branches/release/libs/scope_exit/test/world_this.cpp (from r77042, /trunk/libs/scope_exit/test/world_this.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/world_this.cpp (original)
+++ branches/release/libs/scope_exit/test/world_this.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,51 +6,53 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/scope_exit
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macros required"
+#else
+
 #include <boost/scope_exit.hpp>
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/vector.hpp>
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldThis
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <boost/config.hpp>
 #include <vector>
 
-struct person; BOOST_TYPEOF_REGISTER_TYPE(person)
 struct person {};
+BOOST_TYPEOF_REGISTER_TYPE(person)
 
-struct world; BOOST_TYPEOF_REGISTER_TYPE(world)
 struct world {
     void add_person(person const& a_person);
+ size_t population(void) const { return persons_.size(); }
+
+private:
     std::vector<person> persons_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(world)
 
 void world::add_person(person const& a_person) {
     bool commit = false;
 
     persons_.push_back(a_person);
-#ifdef BOOST_NO_LAMBDAS
- //[world_this_
+ //[world_this
     BOOST_SCOPE_EXIT(&commit, this_) { // Capture object `this_`.
         if(!commit) this_->persons_.pop_back();
     } BOOST_SCOPE_EXIT_END
     //]
-#else
- //[world_this
- BOOST_SCOPE_EXIT(&commit, this) { // Use `this` (C++11).
- if(!commit) this->persons_.pop_back();
- }; // Use `;` instead of `BOOST_SCOPE_EXIT_END` (C++11).
- //]
-#endif
 
     // ...
 
     commit = true;
 }
 
-BOOST_AUTO_TEST_CASE( test_world_this ) {
+int main(void) {
     world w;
     person p;
     w.add_person(p);
- BOOST_CHECK( w.persons_.size() == 1 );
+ BOOST_TEST(w.population() == 1);
+ return boost::report_errors();
 }
 
+#endif // variadic macros
+

Copied: branches/release/libs/scope_exit/test/world_this_seq.cpp (from r77042, /trunk/libs/scope_exit/test/world_this_seq.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/world_this_seq.cpp (original)
+++ branches/release/libs/scope_exit/test/world_this_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -10,47 +10,40 @@
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/vector.hpp>
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldThisSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <boost/config.hpp>
 #include <vector>
 
-struct person; BOOST_TYPEOF_REGISTER_TYPE(person)
 struct person {};
+BOOST_TYPEOF_REGISTER_TYPE(person)
 
-struct world; BOOST_TYPEOF_REGISTER_TYPE(world)
 struct world {
     void add_person(person const& a_person);
+ size_t population(void) const { return persons_.size(); }
+
+private:
     std::vector<person> persons_;
 };
+BOOST_TYPEOF_REGISTER_TYPE(world)
 
 void world::add_person(person const& a_person) {
     bool commit = false;
 
     persons_.push_back(a_person);
-#ifdef BOOST_NO_LAMBDAS
- //[world_this_
- BOOST_SCOPE_EXIT( (&commit) (this_) ) { // Capture object `this_`.
+ BOOST_SCOPE_EXIT( (&commit) (this_) ) {
         if(!commit) this_->persons_.pop_back();
     } BOOST_SCOPE_EXIT_END
- //]
-#else
- //[world_this
- BOOST_SCOPE_EXIT( (&commit) (this) ) { // Use `this` (C++11).
- if(!commit) this->persons_.pop_back();
- }; // Use `;` instead of `BOOST_SCOPE_EXIT_END` (C++11).
- //]
-#endif
 
     // ...
 
     commit = true;
 }
 
-BOOST_AUTO_TEST_CASE( test_world_this_seq ) {
+int main(void) {
     world w;
     person p;
     w.add_person(p);
- BOOST_CHECK( w.persons_.size() == 1 );
+ BOOST_TEST(w.population() == 1);
+ return boost::report_errors();
 }
 

Copied: branches/release/libs/scope_exit/test/world_tpl.cpp (from r77042, /trunk/libs/scope_exit/test/world_tpl.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/world_tpl.cpp (original)
+++ branches/release/libs/scope_exit/test/world_tpl.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -6,23 +6,30 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // Home at http://www.boost.org/libs/scope_exit
 
+#include <boost/config.hpp>
+#ifdef BOOST_NO_VARIADIC_MACROS
+# error "variadic macro required"
+#else
+
 #include <boost/scope_exit.hpp>
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/vector.hpp>
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldTpl
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 
-struct person; BOOST_TYPEOF_REGISTER_TYPE(peron)
 struct person {};
+BOOST_TYPEOF_REGISTER_TYPE(person)
 
-template<typename Person> struct world; BOOST_TYPEOF_REGISTER_TEMPLATE(world, 1)
 template<typename Person>
 struct world {
     void add_person(Person const& a_person);
+ size_t population(void) const { return persons_.size(); }
+
+private:
     std::vector<Person> persons_;
 };
+BOOST_TYPEOF_REGISTER_TEMPLATE(world, 1)
 
 //[world_tpl
 template<typename Person>
@@ -40,10 +47,13 @@
 }
 //]
 
-BOOST_AUTO_TEST_CASE( test_world_tpl ) {
+int main(void) {
     world<person> w;
     person p;
     w.add_person(p);
- BOOST_CHECK( w.persons_.size() == 1 );
+ BOOST_TEST(w.population() == 1);
+ return boost::report_errors();
 }
 
+#endif // variadic macros
+

Copied: branches/release/libs/scope_exit/test/world_tpl_seq.cpp (from r77042, /trunk/libs/scope_exit/test/world_tpl_seq.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/world_tpl_seq.cpp (original)
+++ branches/release/libs/scope_exit/test/world_tpl_seq.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -10,21 +10,22 @@
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/vector.hpp>
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldTplSeq
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 
-struct person; BOOST_TYPEOF_REGISTER_TYPE(person)
 struct person {};
+BOOST_TYPEOF_REGISTER_TYPE(person)
 
-template<typename Person> struct world; BOOST_TYPEOF_REGISTER_TEMPLATE(world, 1)
 template<typename Person>
 struct world {
     void add_person(Person const& a_person);
+ size_t population(void) const { return persons_.size(); }
+
+private:
     std::vector<Person> persons_;
 };
+BOOST_TYPEOF_REGISTER_TEMPLATE(world, 1)
 
-//[world_tpl_seq
 template<typename Person>
 void world<Person>::add_person(Person const& a_person) {
     bool commit = false;
@@ -38,12 +39,12 @@
 
     commit = true;
 }
-//]
 
-BOOST_AUTO_TEST_CASE( test_world_tpl_seq ) {
+int main(void) {
     world<person> w;
     person p;
     w.add_person(p);
- BOOST_CHECK( w.persons_.size() == 1 );
+ BOOST_TEST(w.population() == 1);
+ return boost::report_errors();
 }
 

Copied: branches/release/libs/scope_exit/test/world_void.cpp (from r77042, /trunk/libs/scope_exit/test/world_void.cpp)
==============================================================================
--- /trunk/libs/scope_exit/test/world_void.cpp (original)
+++ branches/release/libs/scope_exit/test/world_void.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -10,14 +10,15 @@
 #include <boost/typeof/typeof.hpp>
 #include <boost/typeof/std/vector.hpp>
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-#define BOOST_TEST_MODULE TestWorldVoid
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
 #include <vector>
 
-struct person; BOOST_TYPEOF_REGISTER_TYPE(person)
 struct person {};
+BOOST_TYPEOF_REGISTER_TYPE(person)
+
+struct world_t;
+BOOST_TYPEOF_REGISTER_TYPE(world_t)
 
-struct world_t; BOOST_TYPEOF_REGISTER_TYPE(world_t)
 //[world_void
 struct world_t {
     std::vector<person> persons;
@@ -38,9 +39,10 @@
 }
 //]
 
-BOOST_AUTO_TEST_CASE( test_world_void ) {
+int main(void) {
     person p;
     add_person(p);
- BOOST_CHECK( world.persons.size() == 1 );
+ BOOST_TEST(world.persons.size() == 1);
+ return boost::report_errors();
 }
 

Modified: branches/release/libs/utility/identity_type/doc/Jamfile.v2
==============================================================================
--- /trunk/libs/utility/identity_type/doc/Jamfile.v2 (original)
+++ branches/release/libs/utility/identity_type/doc/Jamfile.v2 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -15,7 +15,7 @@
         <doxygen:param>WARN_IF_UNDOCUMENTED=NO
         <doxygen:param>HIDE_UNDOC_MEMBERS=YES
         <doxygen:param>HIDE_UNDOC_CLASSES=YES
- <doxygen:param>ALIASES=" Params=\"<b>Parameters:</b> <table border="0">\" Param{2}=\"<tr><td><b><tt>\\1</tt></b></td><td>\\2</td></tr>\" EndParams=\"</table>\" Returns=\"<b>Returns:</b>\" Note=\"<b>Note:</b>\" Warning=\"<b>Warning:</b>\" See=\"<b>See:</b>\" RefSect{1}=\"\\xmlonly<link linkend='boost_utility_identitytype.\\1'>\\1</link>\\endxmlonly\" RefSectId{2}=\"\\xmlonly<link linkend='boost_utility_identitytype.\\1'>\\2</link>\\endxmlonly\" RefClass{1}=\"\\xmlonly<computeroutput><classname alt='\\1'>\\1</classname></computeroutput>\\endxmlonly\" RefFunc{1}=\"\\xmlonly<computeroutput><functionname alt='\\1'>\\1</functionname></computeroutput>\\endxmlonly\" RefMacro{1}=\"\\xmlonly<computeroutput><macroname alt='\\1'>\\1</macroname></computeroutput>\\endxmlonly\" "
+ <doxygen:param>ALIASES=" Params=\"<b>Parameters:</b> <table border="0">\" Param{2}=\"<tr><td><b><tt>\\1</tt></b></td><td>\\2</td></tr>\" EndParams=\"</table>\" Returns=\"<b>Returns:</b>\" Note=\"<b>Note:</b>\" Warning=\"<b>Warning:</b>\" See=\"<b>See:</b>\" RefSect{2}=\"\\xmlonly<link linkend='boost_utility_identitytype.\\1'>\\2</link>\\endxmlonly\" RefClass{1}=\"\\xmlonly<computeroutput><classname alt='\\1'>\\1</classname></computeroutput>\\endxmlonly\" RefFunc{1}=\"\\xmlonly<computeroutput><functionname alt='\\1'>\\1</functionname></computeroutput>\\endxmlonly\" RefMacro{1}=\"\\xmlonly<computeroutput><macroname alt='\\1'>\\1</macroname></computeroutput>\\endxmlonly\" "
     ;
 
 # This target must be called "index" so to generate "index.html" file.

Modified: branches/release/libs/utility/identity_type/doc/html/index.html
==============================================================================
--- /trunk/libs/utility/identity_type/doc/html/index.html (original)
+++ branches/release/libs/utility/identity_type/doc/html/index.html 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -4,16 +4,17 @@
         file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt)
       </p></div></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section">Motivation</span></dt><dt><span class="section">Solution</span></dt><dt><span class="section">Templates</span></dt><dt><span class="section">Abstract Types</span></dt><dt><span class="section">Annex: Usage</span></dt><dt><span class="section"><a href="#boost_utility_identitytype.annex__implementation">Annex:
     Implementation</a></span></dt><dt><span class="section">Reference</span></dt></dl></div><p>
- 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 types within round parenthesis so they can always
+ be passed as macro parameters.
   </p><div class="section boost_utility_identitytype_motivation" title="Motivation"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="boost_utility_identitytype.motivation"></a><a class="link" href="#boost_utility_identitytype.motivation" title="Motivation">Motivation</a></h2></div></div></div><p>
- Consider the following macro which declares a variable named <code class="computeroutput"><span class="identifier">var</span></code><span class="emphasis"><em>n</em></span> with the specified
- <span class="emphasis"><em>type</em></span> (see also var_err.cpp):
+ Consider the following macro which declares a variable named <code class="computeroutput"><span class="identifier">var</span></code><code class="literal"><span class="emphasis"><em>n</em></span></code>
+ with the specified <code class="literal"><span class="emphasis"><em>type</em></span></code> (see also
+ var_error.cpp):
     </p><p>
 </p><pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">VAR</span><span class="special">(</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">n</span><span class="special">)</span> <span class="identifier">type</span> <span class="identifier">var</span> <span class="error">#</span><span class="preprocessor"># n</span>
 
-<span class="identifier">VAR</span><span class="special">(</span> <span class="keyword">int</span><span class="special">,</span> <span class="number">1</span> <span class="special">);</span> <span class="comment">// OK.</span>
-<span class="identifier">VAR</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">&gt;,</span> <span class="number">2</span> <span class="special">);</span> <span class="comment">// Error.</span>
+<span class="identifier">VAR</span><span class="special">(</span><span class="keyword">int</span><span class="special">,</span> <span class="number">1</span><span class="special">);</span> <span class="comment">// OK.</span>
+<span class="identifier">VAR</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">&gt;,</span> <span class="number">2</span><span class="special">);</span> <span class="comment">// Error.</span>
 </pre><p>
     </p><p>
       The first macro invocation works correctly declaring a variable named <code class="computeroutput"><span class="identifier">var1</span></code> of type <code class="computeroutput"><span class="keyword">int</span></code>.
@@ -35,50 +36,59 @@
           <code class="computeroutput"><span class="number">2</span></code>
         </li></ol></div><p>
       Note that, differently from the compiler, the preprocessor only recognizes
- round parameters <code class="computeroutput"><span class="special">()</span></code>. Angular
- <code class="computeroutput"><span class="special">&lt;&gt;</span></code> or squared <code class="computeroutput"><span class="special">[]</span></code> parenthesis are not used by the preprocessor
- when parsing the macro parameters.
+ round parenthesis <code class="computeroutput"><span class="special">()</span></code>. Angular
+ <code class="computeroutput"><span class="special">&lt;&gt;</span></code> and squared <code class="computeroutput"><span class="special">[]</span></code> parenthesis are not recognized by the preprocessor
+ when parsing macro parameters.
     </p></div><div class="section boost_utility_identitytype_solution" title="Solution"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="boost_utility_identitytype.solution"></a><a class="link" href="#boost_utility_identitytype.solution" title="Solution">Solution</a></h2></div></div></div><p>
       In some cases, it might be possible to workaround this issue by avoiding to
- pass the type expression to the macro all together. For example, in some cases
- a <code class="computeroutput"><span class="keyword">typedef</span></code> can be used to specify
- the type expression with the commas outside the macro (see also var.cpp):
+ pass the type expression to the macro all together. For example, in the case
+ above a <code class="computeroutput"><span class="keyword">typedef</span></code> could have been
+ used to specify the type expression with the commas outside the macro (see
+ also var.cpp):
     </p><p>
 </p><pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">&gt;</span> <span class="identifier">map_type</span><span class="special">;</span>
-<span class="identifier">VAR</span><span class="special">(</span> <span class="identifier">map_type</span><span class="special">,</span> <span class="number">3</span> <span class="special">);</span> <span class="comment">// OK.</span>
+<span class="identifier">VAR</span><span class="special">(</span><span class="identifier">map_type</span><span class="special">,</span> <span class="number">3</span><span class="special">);</span> <span class="comment">// OK.</span>
 </pre><p>
     </p><p>
- When this is not possible or desired (e.g., see the function template <code class="computeroutput"><span class="identifier">f</span></code> in the section below), the library header
- <code class="computeroutput"><a class="link" href="#header.boost.utility.identity_type_hpp" title="Header &lt;boost/utility/identity_type.hpp&gt;">boost/utility/identity_type.hpp</a></code>
+ When this is neither possible nor desired (e.g., see the function template
+ <code class="computeroutput"><span class="identifier">f</span></code> in the section below), this
+ library header <code class="computeroutput"><a class="link" href="#header.boost.utility.identity_type_hpp" title="Header &lt;boost/utility/identity_type.hpp&gt;">boost/utility/identity_type.hpp</a></code>
       defines a macro <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>
       which can be used to workaround the issue while keeping the type expression
       as one of the macro parameters (see also var.cpp).
     </p><p>
 </p><pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">utility</span><span class="special">/</span><span class="identifier">identity_type</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 
-<span class="identifier">VAR</span><span class="special">(</span> <span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">&gt;)),</span> <span class="number">4</span> <span class="special">);</span> <span class="comment">// OK.</span>
+<span class="identifier">VAR</span><span class="special">(</span><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">&gt;)),</span> <span class="number">4</span><span class="special">);</span> <span class="comment">// OK.</span>
 </pre><p>
     </p><p>
- This macro expands to an expression that evaluates (at compile-time) to the
- specified type. The specified type is never split into multiple macro parameters
- because it is always wrapped by a set of extra round parenthesis <code class="computeroutput"><span class="special">()</span></code>. In fact, a total of two sets of round parenthesis
- must be used: The parenthesis to invoke the macro <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">(...)</span></code> plus the inner parenthesis to wrap the
+ The <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code> macro
+ expands to an expression that evaluates (at compile-time) to the specified
+ type. The specified type is never split into multiple macro parameters because
+ it is always wrapped by a set of extra round parenthesis <code class="computeroutput"><span class="special">()</span></code>.
+ In fact, a total of two sets of round parenthesis must be used: The parenthesis
+ to invoke the macro <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">(...)</span></code> plus the inner parenthesis to wrap the
       type passed to the macro <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((...))</span></code>.
     </p><p>
       This macro works on any C++03
- compiler (because it does not use <a href="http://en.wikipedia.org/wiki/Variadic_macro" target="_top">variadic
- macros</a>). <sup>[<a name="boost_utility_identitytype.solution.f0" href="#ftn.boost_utility_identitytype.solution.f0" class="footnote">1</a>]</sup>
+ compiler (and it does not use <a href="http://en.wikipedia.org/wiki/Variadic_macro" target="_top">variadic
+ macros</a>). <sup>[<a name="boost_utility_identitytype.solution.f0" href="#ftn.boost_utility_identitytype.solution.f0" class="footnote">1</a>]</sup> The authors originally developed and tested this library using
+ GNU Compiler Collection (GCC) C++ 4.5.3 (with and without C++11 features enabled
+ <code class="computeroutput"><span class="special">-</span><span class="identifier">std</span><span class="special">=</span><span class="identifier">c</span><span class="special">++</span><span class="number">0</span><span class="identifier">x</span></code>) on Cygwin
+ and Miscrosoft Visual C++ (MSVC) 8.0 on Windows 7. See the library <a href="http://www.boost.org/development/tests/release/developer/utility-identity_type.html" target="_top">regressions
+ test results</a> for more information on supported compilers and platforms.
     </p></div><div class="section boost_utility_identitytype_templates" title="Templates"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="boost_utility_identitytype.templates"></a><a class="link" href="#boost_utility_identitytype.templates" title="Templates">Templates</a></h2></div></div></div><p>
       This macro must be prefixed by <code class="computeroutput"><span class="keyword">typename</span></code>
       when used within templates. For example, let's program a macro that declares
- a function parameter named <code class="computeroutput"><span class="identifier">arg</span></code><span class="emphasis"><em>n</em></span>
- with the specified <span class="emphasis"><em>type</em></span> (see also template.cpp):
+ a function parameter named <code class="computeroutput"><span class="identifier">arg</span></code><code class="literal"><span class="emphasis"><em>n</em></span></code>
+ with the specified <code class="literal"><span class="emphasis"><em>type</em></span></code> (see also
+ template.cpp):
     </p><p>
 </p><pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">ARG</span><span class="special">(</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">n</span><span class="special">)</span> <span class="identifier">type</span> <span class="identifier">arg</span> <span class="error">#</span><span class="preprocessor"># n</span>
 
 <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
 <span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span> <span class="comment">// Prefix macro with `typename` in templates.</span>
- <span class="identifier">ARG</span><span class="special">(</span> <span class="keyword">typename</span> <span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;)),</span> <span class="number">1</span> <span class="special">)</span>
+ <span class="identifier">ARG</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;)),</span> <span class="number">1</span><span class="special">)</span>
 <span class="special">)</span> <span class="special">{</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">arg1</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
 <span class="special">}</span>
@@ -87,20 +97,21 @@
 </p><pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">&gt;</span> <span class="identifier">a</span><span class="special">;</span>
 <span class="identifier">a</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="char">'a'</span><span class="special">;</span>
 
-<span class="identifier">f</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">&gt;(</span><span class="identifier">a</span><span class="special">);</span> <span class="comment">// OK.</span>
-<span class="comment">// f(a); // But error.</span>
+<span class="identifier">f</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">&gt;(</span><span class="identifier">a</span><span class="special">);</span> <span class="comment">// OK...</span>
+<span class="comment">// f(a); // ... but error.</span>
 </pre><p>
     </p><p>
- However, note that the template parameter type <code class="computeroutput"><span class="keyword">char</span></code>
- must be explicitly specified when invoking the function <code class="computeroutput"><span class="identifier">f</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">&gt;(</span><span class="identifier">a</span><span class="special">)</span></code>. In fact,
+ However, note that the template parameter <code class="computeroutput"><span class="keyword">char</span></code>
+ must be manually specified when invoking the function as in <code class="computeroutput"><span class="identifier">f</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">&gt;(</span><span class="identifier">a</span><span class="special">)</span></code>. In fact,
       when the <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>
       macro is used to wrap a function template parameter, the template parameter
- can no longer be implicitly determined by the compiler form the function call
- as in <code class="computeroutput"><span class="identifier">f</span><span class="special">(</span><span class="identifier">a</span><span class="special">)</span></code>. (This
- limitation does not apply to class templates because class template parameters
- must always be explicitly specified.) In other words, without using the <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code> macro, C++ would
- normally be able to implicitly deduce the function template parameter as shown
- below:
+ can no longer be automatically deduced by the compiler form the function call
+ as <code class="computeroutput"><span class="identifier">f</span><span class="special">(</span><span class="identifier">a</span><span class="special">)</span></code> would
+ have done. <sup>[<a name="boost_utility_identitytype.templates.f0" href="#ftn.boost_utility_identitytype.templates.f0" class="footnote">2</a>]</sup> (This limitation does not apply to class templates because class
+ template parameters must always be explicitly specified.) In other words, without
+ using the <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>
+ macro, C++ would normally be able to automatically deduce the function template
+ parameter as shown below:
     </p><p>
 </p><pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
 <span class="keyword">void</span> <span class="identifier">g</span><span class="special">(</span>
@@ -110,21 +121,20 @@
 <span class="special">}</span>
 </pre><p>
     </p><p>
-</p><pre class="programlisting"><span class="identifier">g</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">&gt;(</span><span class="identifier">a</span><span class="special">);</span> <span class="comment">// OK.</span>
-<span class="identifier">g</span><span class="special">(</span><span class="identifier">a</span><span class="special">);</span> <span class="comment">// Also OK.</span>
+</p><pre class="programlisting"><span class="identifier">g</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">&gt;(</span><span class="identifier">a</span><span class="special">);</span> <span class="comment">// OK...</span>
+<span class="identifier">g</span><span class="special">(</span><span class="identifier">a</span><span class="special">);</span> <span class="comment">// ... and also OK.</span>
 </pre><p>
     </p></div><div class="section boost_utility_identitytype_abstract_types" title="Abstract Types"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="boost_utility_identitytype.abstract_types"></a><a class="link" href="#boost_utility_identitytype.abstract_types" title="Abstract Types">Abstract Types</a></h2></div></div></div><p>
- On some compilers (e.g., GCC), using this macro on abstract types (i.e., a
- class with one or more pure virtual functions) generates a compiler error.
- This can be worked around by manipulating the type adding and removing a reference
- to it.
+ On some compilers (e.g., GCC), using this macro on abstract types (i.e., classes
+ with one or more pure virtual functions) generates a compiler error. This can
+ be avoided by manipulating the type adding and removing a reference to it.
     </p><p>
       Let's program a macro that performs a static assertion on a <a href="http://en.wikipedia.org/wiki/Template_metaprogramming" target="_top">Template
       Meta-Programming</a> (TMP) meta-function (similarly to Boost.MPL BOOST_MPL_ASSERT). The <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code> macro can be used
       to pass a meta-function with multiple template parameters to the assert macro
       (so to handle the commas separating the template parameters). In this case,
       if the meta-function is an abstract type, it needs to be manipulated adding
- and removing a reference to it (see also tmp_assert.cpp):
+ and removing a reference to it (see also abstract.cpp):
     </p><p>
 </p><pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">TMP_ASSERT</span><span class="special">(</span><span class="identifier">metafunction</span><span class="special">)</span> <span class="special">\</span>
     <span class="identifier">BOOST_STATIC_ASSERT</span><span class="special">(</span><span class="identifier">metafunction</span><span class="special">::</span><span class="identifier">value</span><span class="special">)</span>
@@ -132,7 +142,7 @@
 <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">bool</span> <span class="identifier">b</span><span class="special">&gt;</span>
 <span class="keyword">struct</span> <span class="identifier">abstract</span> <span class="special">{</span>
     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">value</span> <span class="special">=</span> <span class="identifier">b</span><span class="special">;</span>
- <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+ <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="comment">// Pure virtual function.</span>
 <span class="special">};</span>
 
 <span class="identifier">TMP_ASSERT</span><span class="special">(</span>
@@ -147,29 +157,37 @@
 </pre><p>
     </p></div><div class="section boost_utility_identitytype_annex__usage" title="Annex: Usage"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="boost_utility_identitytype.annex__usage"></a><a class="link" href="#boost_utility_identitytype.annex__usage" title="Annex: Usage">Annex: Usage</a></h2></div></div></div><p>
       The <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code> macro
- can be used either in the call of the user-defined macro (as shown by the examples
- so far), or internally to the definition of the user macro. When <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code> is used internally,
- the call of the user macro will only have to specify the extra parenthesis
- (see also tmp_assert.cpp):
+ can be used either when calling a user-defined macro (as shown by the examples
+ so far), or internally when implementing a user-defined macro (as shown below).
+ When <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code> is
+ used in the implementation of the user-defined macro, the caller of the user
+ macro will have to specify the extra parenthesis (see also paren.cpp):
     </p><p>
 </p><pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">TMP_ASSERT_PAREN</span><span class="special">(</span><span class="identifier">parenthesized_metafunction</span><span class="special">)</span> <span class="special">\</span>
     <span class="comment">/* use `BOOST_IDENTITY_TYPE` in macro definition instead of invocation */</span> <span class="special">\</span>
     <span class="identifier">BOOST_STATIC_ASSERT</span><span class="special">(</span><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">(</span><span class="identifier">parenthesized_metafunction</span><span class="special">)::</span><span class="identifier">value</span><span class="special">)</span>
 
-<span class="identifier">TMP_ASSERT_PAREN</span><span class="special">((</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_const</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&gt;</span> <span class="special">));</span>
-<span class="identifier">TMP_ASSERT</span><span class="special">(</span> <span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_const</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&gt;))</span> <span class="special">);</span>
+<span class="preprocessor">#define</span> <span class="identifier">TMP_ASSERT</span><span class="special">(</span><span class="identifier">metafunction</span><span class="special">)</span> <span class="special">\</span>
+ <span class="identifier">BOOST_STATIC_ASSERT</span><span class="special">(</span><span class="identifier">metafunction</span><span class="special">::</span><span class="identifier">value</span><span class="special">)</span>
+
+<span class="comment">// Specify only extra parenthesis `((...))`.</span>
+<span class="identifier">TMP_ASSERT_PAREN</span><span class="special">((</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_const</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&gt;));</span>
+
+<span class="comment">// Specify both the extra parenthesis `((...))` and `BOOST_IDENTITY_TYPE` macro.</span>
+<span class="identifier">TMP_ASSERT</span><span class="special">(</span><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_const</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&gt;)));</span>
 </pre><p>
     </p><p>
- However, note that the user will <span class="emphasis"><em>always</em></span> have to specify
+ However, note that the caller will <span class="emphasis"><em>always</em></span> have to specify
       the extra parenthesis even when the macro parameters contain no comma:
     </p><p>
-</p><pre class="programlisting"><span class="identifier">TMP_ASSERT_PAREN</span><span class="special">((</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_const</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="keyword">const</span><span class="special">&gt;</span> <span class="special">));</span> <span class="comment">// Always extra `()`.</span>
-<span class="identifier">TMP_ASSERT</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_const</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="keyword">const</span><span class="special">&gt;</span> <span class="special">);</span> <span class="comment">// No extra `()` and no macro.</span>
+</p><pre class="programlisting"><span class="identifier">TMP_ASSERT_PAREN</span><span class="special">((</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_const</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="keyword">const</span><span class="special">&gt;));</span> <span class="comment">// Always extra `((...))`.</span>
+
+<span class="identifier">TMP_ASSERT</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_const</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="keyword">const</span><span class="special">&gt;);</span> <span class="comment">// No extra `((...))` and no macro.</span>
 </pre><p>
     </p><p>
       In some cases, using <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>
- internally might provide the best syntax for the user. For example, this is
- the case for <code class="computeroutput"><span class="identifier">BOOST_MPL_ASSERT</span></code>
+ in the implementation of the user-defined macro might provide the best syntax
+ for the caller. For example, this is the case for <code class="computeroutput"><span class="identifier">BOOST_MPL_ASSERT</span></code>
       because the majority of template meta-programming expressions contain unwrapped
       commas so it is less confusing for the user to always specify the extra parenthesis
       <code class="computeroutput"><span class="special">((...))</span></code> instead of using <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>:
@@ -181,22 +199,23 @@
 <span class="special">));</span>
 </pre><p>
       However, in other situations it might be preferable to not require the extra
- parenthesis in common cases and handle commas as special cases using the <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>. For example, this
- is the case for <code class="computeroutput"><span class="identifier">BOOST_LOCAL_FUNCTION</span></code>
- for which always requiring the extra parenthesis <code class="computeroutput"><span class="special">((...))</span></code>
- around the types would lead to an unnatural syntax for the local function parameter
- types:
+ parenthesis in the common cases and handle commas as special cases using <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>. For example, this
+ is the case for BOOST_LOCAL_FUNCTION for which always
+ requiring the extra parenthesis <code class="computeroutput"><span class="special">((...))</span></code>
+ around the types would lead to an unnatural syntax for the local function signature:
     </p><pre class="programlisting"><span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">((</span><span class="keyword">int</span><span class="special">&amp;))</span> <span class="identifier">x</span><span class="special">,</span> <span class="special">((</span><span class="keyword">int</span><span class="special">&amp;))</span> <span class="identifier">y</span> <span class="special">)</span> <span class="special">{</span> <span class="comment">// Unnatural syntax.</span>
     <span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span><span class="special">;</span>
 <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add</span><span class="special">)</span>
 </pre><p>
       Instead requiring the user to specify <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>
- when needed allows for the more natural syntax <code class="computeroutput"><span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">int</span><span class="special">&amp;</span>
+ only when needed allows for the more natural syntax <code class="computeroutput"><span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">int</span><span class="special">&amp;</span>
       <span class="identifier">x</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">)</span></code> in the common cases when the parameter types
- contain no comma.
+ contain no comma (while still allowing to specify parameter types with commas
+ as special cases using <code class="computeroutput"><span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">&gt;))&amp;</span>
+ <span class="identifier">x</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">)</span></code>).
     </p></div><div class="section boost_utility_identitytype_annex__implementation" title="Annex: Implementation"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="boost_utility_identitytype.annex__implementation"></a><a class="link" href="#boost_utility_identitytype.annex__implementation" title="Annex: Implementation">Annex:
     Implementation</a></h2></div></div></div><p>
- The implementation of this library macro is equivalent to the following: <sup>[<a name="boost_utility_identitytype.annex__implementation.f0" href="#ftn.boost_utility_identitytype.annex__implementation.f0" class="footnote">2</a>]</sup>
+ The implementation of this library macro is equivalent to the following: <sup>[<a name="boost_utility_identitytype.annex__implementation.f0" href="#ftn.boost_utility_identitytype.annex__implementation.f0" class="footnote">3</a>]</sup>
     </p><pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">function_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 
 <span class="preprocessor">#define</span> <span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">(</span><span class="identifier">parenthesized_type</span><span class="special">)</span> <span class="special">\</span>
@@ -204,25 +223,30 @@
 </pre><p>
       Essentially, the type is wrapped between round parenthesis <code class="computeroutput"><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span>
       <span class="keyword">char</span><span class="special">&gt;)</span></code>
- so it can be passed as a macro parameter even if it contain commas. Then the
- parenthesized type is transformed into the type of a function returning <code class="computeroutput"><span class="keyword">void</span></code> and with the specified type as the type
- of the first and only argument <code class="computeroutput"><span class="keyword">void</span>
+ so it can be passed as a single macro parameter even if it contains commas.
+ Then the parenthesized type is transformed into the type of a function returning
+ <code class="computeroutput"><span class="keyword">void</span></code> and with the specified type
+ as the type of the first and only argument <code class="computeroutput"><span class="keyword">void</span>
       <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">&gt;)</span></code>. Finally, the type of the first argument
- <code class="computeroutput"><span class="identifier">arg1_type</span></code> is extracted therefore
- obtaining the original type from the parenthesized type (effectively stripping
- the parenthesis from around the type).
+ <code class="computeroutput"><span class="identifier">arg1_type</span></code> is extracted at compile-time
+ using the <code class="computeroutput"><span class="identifier">function_traits</span></code> meta-function
+ therefore obtaining the original type from the parenthesized type (effectively
+ stripping the extra parenthesis from around the specified type).
     </p></div><div class="section reference" title="Reference"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="reference"></a>Reference</h2></div></div></div><div class="section header_boost_utility_identity_type_hpp" title="Header &lt;boost/utility/identity_type.hpp&gt;"><div class="titlepage"><div><div><h3 class="title"><a name="header.boost.utility.identity_type_hpp"></a>Header &lt;boost/utility/identity_type.hpp&gt;</h3></div></div></div><p>Wrap type expressions with round parenthesis so they can be passed to macros even if they contain commas. </p><pre class="synopsis">
 
 <a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a>(parenthesized_type)</pre><div class="refentry" title="Macro BOOST_IDENTITY_TYPE"><a name="BOOST_IDENTITY_TYPE"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">Macro BOOST_IDENTITY_TYPE</span></h2><p>BOOST_IDENTITY_TYPE — This macro allows to wrap the specified type expression within extra round parenthesis so the type can be passed as a single macro parameter even if it contains commas (not already wrapped within round parenthesis). </p></div><h2 class="refsynopsisdiv-title">Synopsis</h2><div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="#header.boost.utility.identity_type_hpp" title="Header &lt;boost/utility/identity_type.hpp&gt;">boost/utility/identity_type.hpp</a>&gt;
 
-</span>BOOST_IDENTITY_TYPE(parenthesized_type)</pre></div><div class="refsect1" title="Description"><a name="id561548"></a><h2>Description</h2><p><span class="bold"><strong>Parameters:</strong></span> </p><div class="informaltable"><table class="table"><colgroup><col><col></colgroup><tbody><tr><td><span class="bold"><strong><code class="computeroutput">parenthesized_type</code></strong></span></td><td>The type expression to be passed as macro parameter wrapped by a single set of round parenthesis <code class="computeroutput">(...)</code>. This type expression can contain an arbitrary number of commas. </td></tr></tbody></table></div><p>
-</p><p>This macro works on any C++03 compiler (it does not require variadic macros).</p><p>This macro must be prefixed by <code class="computeroutput">typename</code> when used within templates. However, the compiler will not be able to automatically determine function template parameters when they are wrapped with this macro (these parameters need to be explicitly specified when calling the function template).</p><p>On some compilers (like GCC), using this macro on an abstract types requires to add and remove a reference to the type. </p></div></div></div></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a id="ftn.boost_utility_identitytype.solution.f0" href="#boost_utility_identitytype.solution.f0" class="para">1</a>] </sup>
- Using variadic macros, it would be possible to use a single set of parenthesis
- <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">(</span></code><span class="emphasis"><em>type</em></span><code class="computeroutput"><span class="special">)</span></code> instead of two <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((</span></code><span class="emphasis"><em>type</em></span><code class="computeroutput"><span class="special">))</span></code>
- but variadic macros are not part of C++03 (even if nowadays they are supported
- by most modern compilers and they are also part of C++11).
- </p></div><div class="footnote"><p><sup>[<a id="ftn.boost_utility_identitytype.annex__implementation.f0" href="#boost_utility_identitytype.annex__implementation.f0" class="para">2</a>] </sup>
+</span>BOOST_IDENTITY_TYPE(parenthesized_type)</pre></div><div class="refsect1" title="Description"><a name="id554262"></a><h2>Description</h2><p><span class="bold"><strong>Parameters:</strong></span> </p><div class="informaltable"><table class="table"><colgroup><col><col></colgroup><tbody><tr><td><span class="bold"><strong><code class="computeroutput">parenthesized_type</code></strong></span></td><td>The type expression to be passed as macro parameter wrapped by a single set of round parenthesis <code class="computeroutput">(...)</code>. This type expression can contain an arbitrary number of commas. </td></tr></tbody></table></div><p>
+</p><p>This macro works on any C++03 compiler (it does not use variadic macros).</p><p>This macro must be prefixed by <code class="computeroutput">typename</code> when used within templates. Note that the compiler will not be able to automatically determine function template parameters when they are wrapped with this macro (these parameters need to be explicitly specified when calling the function template).</p><p>On some compilers (like GCC), using this macro on abstract types requires to add and remove a reference to the specified type. </p></div></div></div></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a id="ftn.boost_utility_identitytype.solution.f0" href="#boost_utility_identitytype.solution.f0" class="para">1</a>] </sup>
+ Using variadic macros, it would be possible to require a single set of extra
+ parenthesis <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">(</span></code><code class="literal"><span class="emphasis"><em>type</em></span></code><code class="computeroutput"><span class="special">)</span></code> instead of two <code class="computeroutput"><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((</span></code><code class="literal"><span class="emphasis"><em>type</em></span></code><code class="computeroutput"><span class="special">))</span></code> but variadic macros are not part of C++03
+ (even if nowadays they are supported by most modern compilers and they are
+ also part of C++11).
+ </p></div><div class="footnote"><p><sup>[<a id="ftn.boost_utility_identitytype.templates.f0" href="#boost_utility_identitytype.templates.f0" class="para">2</a>] </sup>
+ This is because the implementation of <code class="computeroutput"><a class="link" href="#BOOST_IDENTITY_TYPE" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>
+ wraps the specified type within a meta-function.
+ </p></div><div class="footnote"><p><sup>[<a id="ftn.boost_utility_identitytype.annex__implementation.f0" href="#boost_utility_identitytype.annex__implementation.f0" class="para">3</a>] </sup>
         There is absolutely no guarantee that the macro is actually implemented using
- the code listed in this documentation. This code is for explanatory purposes
- only.
+ the code listed in this documentation. The listed code is for explanatory
+ purposes only.
       </p></div></div></div></body></html>

Modified: branches/release/libs/utility/identity_type/doc/identity_type.qbk
==============================================================================
--- /trunk/libs/utility/identity_type/doc/identity_type.qbk (original)
+++ branches/release/libs/utility/identity_type/doc/identity_type.qbk 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -19,18 +19,19 @@
     [category Utilities]
 ]
 
-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 types within round parenthesis so they can always be passed as macro parameters.
 
-[import ../test/var_err.cpp]
+[import ../test/var_error.cpp]
 [import ../test/var.cpp]
 [import ../test/template.cpp]
-[import ../test/tmp_assert.cpp]
+[import ../test/abstract.cpp]
+[import ../test/paren.cpp]
 
 [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`.
 However, the second macro invocation fails generating a preprocessor error similar to the following:
@@ -46,45 +47,50 @@
 # `char>`
 # `2`
 
-Note that, differently from the compiler, the preprocessor only recognizes round parameters `()`.
-Angular `<>` or squared `[]` parenthesis are not used by the preprocessor when parsing the macro parameters.
+Note that, differently from the compiler, the preprocessor only recognizes round parenthesis `()`.
+Angular `<>` and squared `[]` parenthesis are not recognized by the preprocessor when parsing macro parameters.
 
 [endsect]
 
 [section Solution]
 
 In some cases, it might be possible to workaround this issue by avoiding to pass the type expression to the macro all together.
-For example, in some cases a `typedef` can be used to specify the type expression with the commas outside the macro (see also [@../../test/var.cpp =var.cpp=]):
+For example, in the case above a `typedef` could have been used to specify the type expression with the commas outside the macro (see also [@../../test/var.cpp =var.cpp=]):
 
 [var_typedef]
 
-When this is not possible or desired (e.g., see the function template `f` in the section below), the library header [headerref boost/utility/identity_type.hpp] defines a macro [macroref BOOST_IDENTITY_TYPE] which can be used to workaround the issue while keeping the type expression as one of the macro parameters (see also [@../../test/var.cpp =var.cpp=]).
+When this is neither possible nor desired (e.g., see the function template `f` in the section below), this library header [headerref boost/utility/identity_type.hpp] defines a macro [macroref BOOST_IDENTITY_TYPE] which can be used to workaround the issue while keeping the type expression as one of the macro parameters (see also [@../../test/var.cpp =var.cpp=]).
 
 [var_ok]
 
-This macro expands to an expression that evaluates (at compile-time) to the specified type.
+The [macroref BOOST_IDENTITY_TYPE] macro expands to an expression that evaluates (at compile-time) to the specified type.
 The specified type is never split into multiple macro parameters because it is always wrapped by a set of extra round parenthesis `()`.
 In fact, a total of two sets of round parenthesis must be used: The parenthesis to invoke the macro `BOOST_IDENTITY_TYPE(...)` plus the inner parenthesis to wrap the type passed to the macro `BOOST_IDENTITY_TYPE((...))`.
 
-This macro works on any [@http://www.open-std.org/JTC1/SC22/WG21/docs/standards C++03] compiler (because it does not use [@http://en.wikipedia.org/wiki/Variadic_macro variadic macros]).
+This macro works on any [@http://www.open-std.org/JTC1/SC22/WG21/docs/standards C++03] compiler (and it does not use [@http://en.wikipedia.org/wiki/Variadic_macro variadic macros]).
 [footnote
-Using variadic macros, it would be possible to use a single set of parenthesis `BOOST_IDENTITY_TYPE(`/type/`)` instead of two `BOOST_IDENTITY_TYPE((`/type/`))` but variadic macros are not part of C++03 (even if nowadays they are supported by most modern compilers and they are also part of C++11).
+Using variadic macros, it would be possible to require a single set of extra parenthesis `BOOST_IDENTITY_TYPE(`[^['type]]`)` instead of two `BOOST_IDENTITY_TYPE((`[^['type]]`))` but variadic macros are not part of C++03 (even if nowadays they are supported by most modern compilers and they are also part of C++11).
 ]
+The authors originally developed and tested this library using GNU Compiler Collection (GCC) C++ 4.5.3 (with and without C++11 features enabled `-std=c++0x`) on Cygwin and Miscrosoft Visual C++ (MSVC) 8.0 on Windows 7.
+See the library [@http://www.boost.org/development/tests/release/developer/utility-identity_type.html regressions test results] for more information on supported compilers and platforms.
 
 [endsect]
 
 [section Templates]
 
 This macro must be prefixed by `typename` when used within templates.
-For example, let's program a macro that declares a function parameter named `arg`/n/ with the specified /type/ (see also [@../../test/template.cpp =template.cpp=]):
+For example, let's program a macro that declares a function parameter named `arg`[^['n]] with the specified [^['type]] (see also [@../../test/template.cpp =template.cpp=]):
 
 [template_f_decl]
 [template_f_call]
 
-However, note that the template parameter type `char` must be explicitly specified when invoking the function `f<char>(a)`.
-In fact, when the [macroref BOOST_IDENTITY_TYPE] macro is used to wrap a function template parameter, the template parameter can no longer be implicitly determined by the compiler form the function call as in `f(a)`.
+However, note that the template parameter `char` must be manually specified when invoking the function as in `f<char>(a)`.
+In fact, when the [macroref BOOST_IDENTITY_TYPE] macro is used to wrap a function template parameter, the template parameter can no longer be automatically deduced by the compiler form the function call as `f(a)` would have done.
+[footnote
+This is because the implementation of [macroref BOOST_IDENTITY_TYPE] wraps the specified type within a meta-function.
+]
 (This limitation does not apply to class templates because class template parameters must always be explicitly specified.)
-In other words, without using the [macroref BOOST_IDENTITY_TYPE] macro, C++ would normally be able to implicitly deduce the function template parameter as shown below:
+In other words, without using the [macroref BOOST_IDENTITY_TYPE] macro, C++ would normally be able to automatically deduce the function template parameter as shown below:
 
 [template_g_decl]
 [template_g_call]
@@ -93,29 +99,29 @@
 
 [section Abstract Types]
 
-On some compilers (e.g., GCC), using this macro on abstract types (i.e., a class with one or more pure virtual functions) generates a compiler error.
-This can be worked around by manipulating the type adding and removing a reference to it.
+On some compilers (e.g., GCC), using this macro on abstract types (i.e., classes with one or more pure virtual functions) generates a compiler error.
+This can be avoided by manipulating the type adding and removing a reference to it.
 
 Let's program a macro that performs a static assertion on a [@http://en.wikipedia.org/wiki/Template_metaprogramming Template Meta-Programming] (TMP) meta-function (similarly to Boost.MPL [@http://www.boost.org/doc/libs/1_36_0/libs/mpl/doc/refmanual/assert.html `BOOST_MPL_ASSERT`]).
 The [macroref BOOST_IDENTITY_TYPE] macro can be used to pass a meta-function with multiple template parameters to the assert macro (so to handle the commas separating the template parameters).
-In this case, if the meta-function is an abstract type, it needs to be manipulated adding and removing a reference to it (see also [@../../test/tmp_assert.cpp =tmp_assert.cpp=]):
+In this case, if the meta-function is an abstract type, it needs to be manipulated adding and removing a reference to it (see also [@../../test/abstract.cpp =abstract.cpp=]):
 
-[tmp_assert_abstract]
+[abstract]
 
 [endsect]
 
 [section Annex: Usage]
 
-The [macroref BOOST_IDENTITY_TYPE] macro can be used either in the call of the user-defined macro (as shown by the examples so far), or internally to the definition of the user macro.
-When [macroref BOOST_IDENTITY_TYPE] is used internally, the call of the user macro will only have to specify the extra parenthesis (see also [@../../test/tmp_assert.cpp =tmp_assert.cpp=]):
+The [macroref BOOST_IDENTITY_TYPE] macro can be used either when calling a user-defined macro (as shown by the examples so far), or internally when implementing a user-defined macro (as shown below).
+When [macroref BOOST_IDENTITY_TYPE] is used in the implementation of the user-defined macro, the caller of the user macro will have to specify the extra parenthesis (see also [@../../test/paren.cpp =paren.cpp=]):
 
-[tmp_assert_alternative]
+[paren]
 
-However, note that the user will /always/ have to specify the extra parenthesis even when the macro parameters contain no comma:
+However, note that the caller will /always/ have to specify the extra parenthesis even when the macro parameters contain no comma:
 
-[tmp_assert_alternative_always]
+[paren_always]
 
-In some cases, using [macroref BOOST_IDENTITY_TYPE] internally might provide the best syntax for the user.
+In some cases, using [macroref BOOST_IDENTITY_TYPE] in the implementation of the user-defined macro might provide the best syntax for the caller.
 For example, this is the case for `BOOST_MPL_ASSERT` because the majority of template meta-programming expressions contain unwrapped commas so it is less confusing for the user to always specify the extra parenthesis `((...))` instead of using [macroref BOOST_IDENTITY_TYPE]:
 
     BOOST_MPL_ASSERT(( // Natural syntax.
@@ -125,14 +131,14 @@
>
     ));
 
-However, in other situations it might be preferable to not require the extra parenthesis in common cases and handle commas as special cases using the [macroref BOOST_IDENTITY_TYPE].
-For example, this is the case for `BOOST_LOCAL_FUNCTION` for which always requiring the extra parenthesis `((...))` around the types would lead to an unnatural syntax for the local function parameter types:
+However, in other situations it might be preferable to not require the extra parenthesis in the common cases and handle commas as special cases using [macroref BOOST_IDENTITY_TYPE].
+For example, this is the case for [@http://www.boost.org/libs/local_function `BOOST_LOCAL_FUNCTION`] for which always requiring the extra parenthesis `((...))` around the types would lead to an unnatural syntax for the local function signature:
 
     int BOOST_LOCAL_FUNCTION( ((int&)) x, ((int&)) y ) { // Unnatural syntax.
         return x + y;
     } BOOST_LOCAL_FUNCTION_NAME(add)
 
-Instead requiring the user to specify [macroref BOOST_IDENTITY_TYPE] when needed allows for the more natural syntax `BOOST_LOCAL_FUNCTION(int& x, int& y)` in the common cases when the parameter types contain no comma.
+Instead requiring the user to specify [macroref BOOST_IDENTITY_TYPE] only when needed allows for the more natural syntax `BOOST_LOCAL_FUNCTION(int& x, int& y)` in the common cases when the parameter types contain no comma (while still allowing to specify parameter types with commas as special cases using `BOOST_LOCAL_FUNCTION(BOOST_IDENTITY_TYPE((std::map<int, char>))& x, int& y)`).
 
 [endsect]
 
@@ -141,7 +147,7 @@
 The implementation of this library macro is equivalent to the following:
 [footnote
 There is absolutely no guarantee that the macro is actually implemented using the code listed in this documentation.
-This code is for explanatory purposes only.
+The listed code is for explanatory purposes only.
 ]
 
     #include <boost/type_traits/function_traits.hpp>
@@ -149,9 +155,9 @@
     #define BOOST_IDENTITY_TYPE(parenthesized_type) \
         boost::function_traits<void parenthesized_type>::arg1_type
 
-Essentially, the type is wrapped between round parenthesis `(std::map<int, char>)` so it can be passed as a macro parameter even if it contain commas.
+Essentially, the type is wrapped between round parenthesis `(std::map<int, char>)` so it can be passed as a single macro parameter even if it contains commas.
 Then the parenthesized type is transformed into the type of a function returning `void` and with the specified type as the type of the first and only argument `void (std::map<int, char>)`.
-Finally, the type of the first argument `arg1_type` is extracted therefore obtaining the original type from the parenthesized type (effectively stripping the parenthesis from around the type).
+Finally, the type of the first argument `arg1_type` is extracted at compile-time using the `function_traits` meta-function therefore obtaining the original type from the parenthesized type (effectively stripping the extra parenthesis from around the specified type).
 
 [endsect]
 

Modified: branches/release/libs/utility/identity_type/test/Jamfile.v2
==============================================================================
--- /trunk/libs/utility/identity_type/test/Jamfile.v2 (original)
+++ branches/release/libs/utility/identity_type/test/Jamfile.v2 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -7,8 +7,10 @@
 
 import testing ;
 
-compile-fail var_err.cpp ;
+compile-fail var_error.cpp ;
 run var.cpp ;
 run template.cpp ;
-run tmp_assert.cpp ;
+run abstract.cpp ;
+run noncopyable.cpp ;
+run paren.cpp ;
 

Modified: branches/release/libs/utility/identity_type/test/template.cpp
==============================================================================
--- /trunk/libs/utility/identity_type/test/template.cpp (original)
+++ branches/release/libs/utility/identity_type/test/template.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -14,7 +14,7 @@
 
 template<typename T>
 void f( // Prefix macro with `typename` in templates.
- ARG( typename BOOST_IDENTITY_TYPE((std::map<int, T>)), 1 )
+ ARG(typename BOOST_IDENTITY_TYPE((std::map<int, T>)), 1)
 ) {
     std::cout << arg1[0] << std::endl;
 }
@@ -34,13 +34,13 @@
     std::map<int, char> a;
     a[0] = 'a';
     
- f<char>(a); // OK.
- // f(a); // But error.
+ f<char>(a); // OK...
+ // f(a); // ... but error.
     //]
 
     //[template_g_call
- g<char>(a); // OK.
- g(a); // Also OK.
+ g<char>(a); // OK...
+ g(a); // ... and also OK.
     //]
     
     return 0;

Deleted: /trunk/libs/utility/identity_type/test/tmp_assert.cpp
==============================================================================
--- /trunk/libs/utility/identity_type/test/tmp_assert.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,51 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/utility/identity_type
-
-#include <boost/utility/identity_type.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/type_traits/is_const.hpp>
-#include <boost/type_traits/add_reference.hpp>
-#include <boost/type_traits/remove_reference.hpp>
-#include <map>
-
-//[tmp_assert_abstract
-#define TMP_ASSERT(metafunction) \
- BOOST_STATIC_ASSERT(metafunction::value)
-
-template<typename T, bool b>
-struct abstract {
- static const bool value = b;
- virtual void f(T const& x) = 0;
-};
-
-TMP_ASSERT(
- boost::remove_reference< // Add and remove
- BOOST_IDENTITY_TYPE(( // reference for
- boost::add_reference< // abstract type.
- abstract<int, true>
- >::type
- ))
- >::type
-);
-//]
-
-//[tmp_assert_alternative
-#define TMP_ASSERT_PAREN(parenthesized_metafunction) \
- /* use `BOOST_IDENTITY_TYPE` in macro definition instead of invocation */ \
- BOOST_STATIC_ASSERT(BOOST_IDENTITY_TYPE(parenthesized_metafunction)::value)
-
-TMP_ASSERT_PAREN(( boost::is_const<std::map<int, char> const> ));
-TMP_ASSERT( BOOST_IDENTITY_TYPE((boost::is_const<std::map<int, char> const>)) );
-//]
-
-//[tmp_assert_alternative_always
-TMP_ASSERT_PAREN(( boost::is_const<int const> )); // Always extra `()`.
-TMP_ASSERT( boost::is_const<int const> ); // No extra `()` and no macro.
-//]
-
-int main() { return 0; }
-

Modified: branches/release/libs/utility/identity_type/test/var.cpp
==============================================================================
--- /trunk/libs/utility/identity_type/test/var.cpp (original)
+++ branches/release/libs/utility/identity_type/test/var.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -9,17 +9,17 @@
 
 #define VAR(type, n) type var ## n
 
-VAR( int, 1 ); // OK.
+VAR(int, 1); // OK.
 
 //[var_typedef
 typedef std::map<int, char> map_type;
-VAR( map_type, 3 ); // OK.
+VAR(map_type, 3); // OK.
 //]
 
 //[var_ok
 #include <boost/utility/identity_type.hpp>
 
-VAR( BOOST_IDENTITY_TYPE((std::map<int, char>)), 4 ); // OK.
+VAR(BOOST_IDENTITY_TYPE((std::map<int, char>)), 4); // OK.
 //]
 
 int main() { return 0; }

Deleted: /trunk/libs/utility/identity_type/test/var_err.cpp
==============================================================================
--- /trunk/libs/utility/identity_type/test/var_err.cpp 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
+++ (empty file)
@@ -1,18 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/utility/identity_type
-
-#include <map>
-
-//[var_err
-#define VAR(type, n) type var ## n
-
-VAR( int, 1 ); // OK.
-VAR( std::map<int, char>, 2 ); // Error.
-//]
-
-int main() { return 0; }
-

Modified: branches/release/status/Jamfile.v2
==============================================================================
--- branches/release/status/Jamfile.v2 (original)
+++ branches/release/status/Jamfile.v2 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -78,6 +78,7 @@
     functional/factory/test # test-suite functional/factory
     functional/forward/test # test-suite functional/forward
     functional/hash/test # test-suite functional/hash
+ functional/overloaded_function/test # test-suite func./overloaded_function
     function_types/test # test-suite function_types
     fusion/test # test-suite fusion
     geometry/test # test-suite geometry
@@ -95,6 +96,7 @@
     iostreams/test # test-suite iostreams
     iterator/test # test-suite iterator
     lambda/test # test-suite lambda
+ local_function/test # test-suite local_function
     locale/test # test-suite locale
     logic/test # test-suite logic
     math/test # test-suite math
@@ -149,6 +151,7 @@
     unordered/test/unordered # test-suite unordered
     unordered/test/exception # test-suite unordered-exception
     utility/enable_if/test # test-suite utility/enable_if
+ utility/identity_type/test # test-suite utility/identity_type
     utility/swap/test # test-suite utility/swap
     utility/test # test-suite utility
     uuid/test # test-suite uuid

Modified: branches/release/status/explicit-failures-markup.xml
==============================================================================
--- branches/release/status/explicit-failures-markup.xml (original)
+++ branches/release/status/explicit-failures-markup.xml 2012-05-23 21:35:04 EDT (Wed, 23 May 2012)
@@ -1942,14 +1942,6 @@
         </mark-expected-failures>
     </library>
     
- <!-- functional/overloaded_function -->
- <library name="functional/overloaded_function">
- <!-- Boost.Preprocessor (iteration?) error on Sun -->
- <mark-unusable>
- <toolset name="sun-5.10"/>
- </mark-unusable>
- </library>
-
     <!-- fusion -->
     <library name="fusion">
         <mark-unusable>
@@ -2451,6 +2443,10 @@
 
     <!-- local_function -->
     <library name="local_function">
+ <mark-unusable>
+ <!-- most Preprocessor tests also fail on this compiler -->
+ <toolset name="cray-8.0"/>
+ </mark-unusable>
         <!-- variadic macros required -->
         <mark-expected-failures>
             <test name="add"/>
@@ -2473,7 +2469,7 @@
             <test name="return_assign"/>
             <test name="return_derivative"/>
             <test name="return_inc"/>
- <test name="return_getset"/>
+ <test name="return_setget"/>
             <test name="return_this"/>
             <test name="same_line"/>
             <test name="transform"/>
@@ -2491,9 +2487,15 @@
             <test name="add_classifiers"/>
             <test name="add_classifiers_seq"/>
             <test name="add_classifiers_seq_nova"/>
+ <toolset name="clang-darwin-trunkLX"/>
+ <toolset name="clang-darwin-trunkRX"/>
             <toolset name="darwin-4.4_0x"/>
- <toolset name="gcc-4.5.3_0x"/>
             <toolset name="gcc-4.4.4_0x"/>
+ <toolset name="gcc-4.5.3_0x"/>
+ <toolset name="gcc-4.6.2_0x"/>
+ <toolset name="gcc-mingw-4.5.2_0x"/>
+ <toolset name="msvc-10.0"/>
+ <toolset name="msvc-11.0"/>
             <note author="Lorenzo Caminiti">
                 This test does not allow C++11 auto-declaration support
                 (beccause it uses the `auto` keyword as storage classifier).
@@ -4981,6 +4983,10 @@
 
     <!-- scope_exit -->
     <library name="scope_exit">
+ <mark-unusable>
+ <!-- most Preprocessor tests also fail on this compiler -->
+ <toolset name="cray-8.0"/>
+ </mark-unusable>
         <mark-expected-failures>
             <test name="emulation_tpl"/>
             <toolset name="intel-*-9.1"/>
@@ -5026,35 +5032,10 @@
             <test name="native_this_tpl"/>
             <test name="native_tpl"/>
             <test name="native_tu_test"/>
- <test name="same_line_seq"/>
- <test name="same_line_seq_nova"/>
- <test name="world_checkpoint_seq"/>
- <test name="world_checkpoint_seq_nova"/>
- <test name="world_seq"/>
- <test name="world_seq_nova"/>
- <test name="world_this_seq"/>
- <test name="world_this_seq_nova"/>
- <test name="world_tpl_seq"/>
- <test name="world_tpl_seq_nova"/>
             <toolset name="sun-5.10"/>
             <note author="Lorenzo Caminiti">
- This compiler does not support native type-of and type-of
- emulation mode is not atuomatically detected for this compiler
- (force it by defining the BOOST_TYPEOF_EMULATION macro).
- </note>
- </mark-expected-failures>
- <!-- MSVC type-of emulation cannot capture `this` -->
- <mark-expected-failures>
- <test name="emulation_this"/>
- <test name="emulation_this_tpl"/>
- <toolset name="msvc-10.0"/>
- <toolset name="msvc-8.0"/>
- <toolset name="msvc-9.0"/>
- <toolset name="msvc-9.0~stlport5.2"/>
- <toolset name="msvc-9.0~wm5~stlport5.2"/>
- <note author="Lorenzo Caminiti">
- This compiler cannot capture the object `this` using type-of
- emulation mode (use native type-of instead).
+ This compiler does not support native type-of (force type-of
+ emulation mode defining the BOOST_TYPEOF_EMULATION macro).
             </note>
         </mark-expected-failures>
         <!-- variadic macros required -->


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