|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75943 - in sandbox/local_function/boost: . detail local_function local_function/aux_ local_function/aux_/function_macros local_function/aux_/macro local_function/aux_/preprocessor/keyword local_function/aux_/preprocessor/keyword/facility local_function/aux_/preprocessor/variadic/variadic_macro_data local_function/aux_/scope_exit local_function/aux_/type_traits local_function/function
From: lorcaminiti_at_[hidden]
Date: 2011-12-14 16:26:17
Author: lcaminiti
Date: 2011-12-14 16:26:15 EST (Wed, 14 Dec 2011)
New Revision: 75943
URL: http://svn.boost.org/trac/boost/changeset/75943
Log:
Renaming files to local_function.
Added:
sandbox/local_function/boost/local_function.hpp
- copied, changed from r75942, /sandbox/local_function/boost/local_function/function.hpp
sandbox/local_function/boost/local_function/aux_/add_pointed_const.hpp
- copied unchanged from r75942, /sandbox/local_function/boost/local_function/aux_/type_traits/add_pointed_const.hpp
sandbox/local_function/boost/local_function/aux_/macro/
- copied from r75942, /sandbox/local_function/boost/local_function/aux_/function_macros/
sandbox/local_function/boost/local_function/aux_/macro/end.hpp
- copied unchanged from r75942, /sandbox/local_function/boost/local_function/aux_/function_macros/name.hpp
sandbox/local_function/boost/local_function/aux_/macro/function.hpp
- copied unchanged from r75942, /sandbox/local_function/boost/local_function/aux_/function_macros/params.hpp
sandbox/local_function/boost/local_function/aux_/preprocessor/keyword/auto.hpp
- copied unchanged from r75940, /sandbox/local_function/boost/detail/preprocessor/keyword/auto.hpp
sandbox/local_function/boost/local_function/aux_/preprocessor/keyword/const.hpp
- copied unchanged from r75940, /sandbox/local_function/boost/detail/preprocessor/keyword/const.hpp
sandbox/local_function/boost/local_function/aux_/preprocessor/keyword/default.hpp
- copied unchanged from r75940, /sandbox/local_function/boost/detail/preprocessor/keyword/default.hpp
sandbox/local_function/boost/local_function/aux_/preprocessor/keyword/facility/
- copied from r75940, /sandbox/local_function/boost/detail/preprocessor/keyword/facility/
sandbox/local_function/boost/local_function/aux_/preprocessor/keyword/inline.hpp
- copied unchanged from r75940, /sandbox/local_function/boost/detail/preprocessor/keyword/inline.hpp
sandbox/local_function/boost/local_function/aux_/preprocessor/keyword/register.hpp
- copied unchanged from r75940, /sandbox/local_function/boost/detail/preprocessor/keyword/register.hpp
sandbox/local_function/boost/local_function/aux_/preprocessor/keyword/return.hpp
- copied unchanged from r75940, /sandbox/local_function/boost/detail/preprocessor/keyword/return.hpp
sandbox/local_function/boost/local_function/aux_/preprocessor/keyword/this.hpp
- copied unchanged from r75940, /sandbox/local_function/boost/detail/preprocessor/keyword/this.hpp
sandbox/local_function/boost/local_function/aux_/preprocessor/keyword/void.hpp
- copied unchanged from r75940, /sandbox/local_function/boost/detail/preprocessor/keyword/void.hpp
sandbox/local_function/boost/local_function/aux_/preprocessor/variadic/variadic_macro_data/
- copied from r75940, /sandbox/local_function/boost/detail/preprocessor/variadic_macro_data/
sandbox/local_function/boost/local_function/function.hpp
- copied unchanged from r75942, /sandbox/local_function/boost/local_function/aux_/function.hpp
Removed:
sandbox/local_function/boost/detail/
sandbox/local_function/boost/local_function/aux_/block.hpp
sandbox/local_function/boost/local_function/aux_/exit.hpp
sandbox/local_function/boost/local_function/aux_/function.hpp
sandbox/local_function/boost/local_function/aux_/function_macros/
sandbox/local_function/boost/local_function/aux_/macro/name.hpp
sandbox/local_function/boost/local_function/aux_/macro/params.hpp
sandbox/local_function/boost/local_function/aux_/overload_base.hpp
sandbox/local_function/boost/local_function/aux_/scope_exit/
sandbox/local_function/boost/local_function/aux_/type_traits/
sandbox/local_function/boost/local_function/block.hpp
sandbox/local_function/boost/local_function/exit.hpp
sandbox/local_function/boost/local_function/function/
sandbox/local_function/boost/local_function/typeof.hpp
Text files modified:
sandbox/local_function/boost/local_function.hpp | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
Copied: sandbox/local_function/boost/local_function.hpp (from r75942, /sandbox/local_function/boost/local_function/function.hpp)
==============================================================================
--- /sandbox/local_function/boost/local_function/function.hpp (original)
+++ sandbox/local_function/boost/local_function.hpp 2011-12-14 16:26:15 EST (Wed, 14 Dec 2011)
@@ -13,6 +13,7 @@
#define BOOST_LOCAL_FUNCTION_HPP_
#include "config.hpp"
+#include "aux_/symbol.hpp"
#include "aux_/function_macros/params.hpp"
#include "aux_/function_macros/name.hpp"
#include <boost/preprocessor/facilities/empty.hpp>
@@ -228,5 +229,44 @@
#define BOOST_LOCAL_FUNCTION_NAME(name) \
BOOST_LOCAL_AUX_FUNCTION_NAME(name)
+/** @todo make this fail is used with this instead of this_ */
+// Bound variable name. Expand to qualified bound type (i.e., bound variable
+// type with extra const and/or & for const and/or reference binds).
+// Can be used with local functions, blocks, and exits. It accepts `this`.
+/**
+ * @brief This macro expands to the fully qualified type of a variable bound
+ * to to local functions, local blocks, and local exits.
+ *
+ * The type is fully qualified in that it contains the extra constant and
+ * reference qualifiers when they are specified for binding by constant and by
+ * reference.
+ * For example, if a variable named <c>t</c> of type <c>T</c> is:
+ * @li Bound by value using <c>bind t</c> then
+ * <c>BOOST_LOCAL_TYPEOF(t)</c> is <c>T</c>.
+ * @li Bound by constant value using <c>const bind t</c>
+ * then <c>BOOST_LOCAL_TYPEOF(t)</c> is <c>const T</c>.
+ * @li Bound by reference using <c>bind& t</c>
+ * then <c>BOOST_LOCAL_TYPEOF(t)</c> is <c>T&</c>.
+ * @li Bound by constant reference using <c>const bind& t</c>
+ * then <c>BOOST_LOCAL_TYPEOF(t)</c> is <c>const T&</c>.
+ *
+ * Within local functions, local blocks, and local exits, this macro can be
+ * used to deduce the bound variable types to declare local variables, check
+ * concepts (using Boost.ConceptCheck), etc (see @RefSect2{Advanced_Topics,
+ * Advanced Topics} section).
+ *
+ * @Params
+ * @Param{bound_variable_name,
+ * The name of the bound variable for which the type is being deduced.
+ * }
+ * @EndParams
+ *
+ * @See @RefMacro{BOOST_LOCAL_FUNCTION_PARAMS}, @RefMacro{BOOST_LOCAL_BLOCK},
+ * @RefMacro{BOOST_LOCAL_EXIT}, @RefSect2{Advanced_Topics, Advanced Topics}
+ * section.
+ */
+#define BOOST_LOCAL_TYPEOF(bound_variable_name) \
+ BOOST_LOCAL_AUX_SYMBOL_TYPEOF_TYPE(bound_variable_name)
+
#endif // #include guard
Deleted: sandbox/local_function/boost/local_function/aux_/block.hpp
==============================================================================
--- sandbox/local_function/boost/local_function/aux_/block.hpp 2011-12-14 16:26:15 EST (Wed, 14 Dec 2011)
+++ (empty file)
@@ -1,27 +0,0 @@
-
-// Copyright (C) 2009-2011 Lorenzo Caminiti
-// Use, modification, and distribution is subject to 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).
-
-#ifndef BOOST_LOCAL_AUX_BLOCK_HPP_
-#define BOOST_LOCAL_AUX_BLOCK_HPP_
-
-#include "symbol.hpp"
-
-// Users can exit a local block (and not enclosing function) using `return;`.
-#define BOOST_LOCAL_AUX_BLOCK( \
- local_function_params_macro, parenthesized_binding) \
- void local_function_params_macro(parenthesized_binding) \
- /* user block code `{ ... }` here */
-
-#define BOOST_LOCAL_AUX_BLOCK_END(id) \
- /* user block code `{ ... }` here */ \
- /* ends the local function declaration */ \
- BOOST_LOCAL_FUNCTION_NAME(inline /* for optimization (never as tparam) */ \
- BOOST_LOCAL_AUX_SYMBOL_BLOCK_FUNCTION_NAME(id)) \
- /* call local funciton and execute block's code imediately */ \
- BOOST_LOCAL_AUX_SYMBOL_BLOCK_FUNCTION_NAME(id)(); \
-
-#endif // #include guard
-
Deleted: sandbox/local_function/boost/local_function/aux_/exit.hpp
==============================================================================
--- sandbox/local_function/boost/local_function/aux_/exit.hpp 2011-12-14 16:26:15 EST (Wed, 14 Dec 2011)
+++ (empty file)
@@ -1,52 +0,0 @@
-
-// Copyright (C) 2009-2011 Lorenzo Caminiti
-// Use, modification, and distribution is subject to 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).
-
-#ifndef BOOST_LOCAL_AUX_EXIT_HPP_
-#define BOOST_LOCAL_AUX_EXIT_HPP_
-
-#include "symbol.hpp"
-#include <boost/function.hpp>
-#include <boost/preprocessor/cat.hpp>
-
-// PRIVATE //
-
-#define BOOST_LOCAL_AUX_EXIT_NAME_(name, id) \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(BOOST_PP_CAT(BOOST_PP_CAT( \
- BOOST_PP_CAT(exit, BOOST_LOCAL_AUX_SYMBOL_INFIX), name), id))
-
-// PUBLIC //
-
-// Users can exit local scope (and not enclosing function) using `return;`
-// (same as with Boost.ScopeExit).
-#define BOOST_LOCAL_AUX_EXIT(local_function_params_macro, \
- parenthesized_binding) \
- void local_function_params_macro(parenthesized_binding) \
- /* user code block `{ ... }` here */
-
-#define BOOST_LOCAL_AUX_EXIT_END(id) \
- /* user code exit `{ ... }` here */ \
- /* ends the local function declaration */ \
- BOOST_LOCAL_FUNCTION_NAME(BOOST_LOCAL_AUX_EXIT_NAME_(function, id)) \
- /* guard resourse -- function invoked when guard obj goes out of scope */ \
- ::boost::local::aux::exit_guard BOOST_LOCAL_AUX_EXIT_NAME_(guard, id)( \
- BOOST_LOCAL_AUX_EXIT_NAME_(function, id));
-
-namespace boost { namespace local { namespace aux {
-
-// Resource destructor exec exit code when obj goes out of local scope.
-struct exit_guard {
- // Exit local functions are always void with no params (and no defaults).
- typedef ::boost::function<void ()> functor_type;
- explicit exit_guard(functor_type f): f_(f) {}
- ~exit_guard() { f_(); } // Invokes function when obj goes out of scope.
-private:
- functor_type f_;
-};
-
-}}} // namespace
-
-#endif // #include guard
-
Deleted: sandbox/local_function/boost/local_function/aux_/function.hpp
==============================================================================
--- sandbox/local_function/boost/local_function/aux_/function.hpp 2011-12-14 16:26:15 EST (Wed, 14 Dec 2011)
+++ (empty file)
@@ -1,185 +0,0 @@
-
-// Copyright (C) 2009-2011 Lorenzo Caminiti
-// Use, modification, and distribution is subject to 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).
-
-#if !BOOST_PP_IS_ITERATING
-# ifndef BOOST_LOCAL_AUX_FUNCTION_HPP_
-# define BOOST_LOCAL_AUX_FUNCTION_HPP_
-
-# include "file.hpp"
-# include "../config.hpp"
-# include <boost/call_traits.hpp>
-# include <boost/preprocessor/iteration/iterate.hpp>
-# include <boost/preprocessor/repetition/repeat.hpp>
-# include <boost/preprocessor/repetition/enum.hpp>
-# include <boost/preprocessor/punctuation/comma_if.hpp>
-# include <boost/preprocessor/arithmetic/sub.hpp>
-# include <boost/preprocessor/arithmetic/inc.hpp>
-# include <boost/preprocessor/cat.hpp>
-
-#define BOOST_LOCAL_AUX_arg_type(z, arg_n, unused) \
- BOOST_PP_CAT(A, arg_n)
-
-#define BOOST_LOCAL_AUX_arg_param_type(z, arg_n, unused) \
- typename ::boost::call_traits<BOOST_LOCAL_AUX_arg_type(z, arg_n, unused) \
- >::param_type
-
-#define BOOST_LOCAL_AUX_arg_name(z, arg_n, unused) \
- BOOST_PP_CAT(a, arg_n)
-
-#define BOOST_LOCAL_AUX_arg(z, arg_n, unused) \
- BOOST_LOCAL_AUX_arg_param_type(z, arg_n, unused) \
- BOOST_LOCAL_AUX_arg_name(z, arg_n, unused)
-
-#define BOOST_LOCAL_AUX_arg_tparam(z, arg_n, unused) \
- typename BOOST_LOCAL_AUX_arg_type(z, arg_n, unused)
-
-#define BOOST_LOCAL_AUX_call_ptr(z, n, unused) \
- BOOST_PP_CAT(call_ptr, n)
-
-#define BOOST_LOCAL_AUX_call_name(z, n, unused) \
- BOOST_PP_CAT(call, n)
-
-#define BOOST_LOCAL_AUX_call_member(z, n, unused) \
- BOOST_PP_CAT(BOOST_LOCAL_AUX_call_name(z, n, unused), _)
-
-#define BOOST_LOCAL_AUX_call_typedef(z, n, arity) \
- typedef R (*BOOST_LOCAL_AUX_call_ptr(z, n, ~))(object_ptr \
- BOOST_PP_COMMA_IF(BOOST_PP_SUB(arity, n)) \
- BOOST_PP_ENUM_ ## z(BOOST_PP_SUB(arity, n), \
- BOOST_LOCAL_AUX_arg_param_type, ~));
-
-#define BOOST_LOCAL_AUX_call_param(z, n, unused) \
- BOOST_LOCAL_AUX_call_ptr(z, n, unused) \
- BOOST_LOCAL_AUX_call_name(z, n, unused)
-
-#define BOOST_LOCAL_AUX_call_decl(z, n, unused) \
- BOOST_LOCAL_AUX_call_ptr(z, n, unused) \
- BOOST_LOCAL_AUX_call_member(z, n, unused);
-
-#define BOOST_LOCAL_AUX_call_init(z, n, unused) \
- BOOST_LOCAL_AUX_call_member(z, n, unused) = \
- BOOST_LOCAL_AUX_call_name(z, n, unuzed);
-
-#define BOOST_LOCAL_AUX_operator_call(z, defaults_n, arity) \
- /* precondition: object_ && call_function_ */ \
- inline R operator()(BOOST_PP_ENUM_ ## z(BOOST_PP_SUB(arity, defaults_n), \
- BOOST_LOCAL_AUX_arg, ~)) const { \
- /* run-time: do not assert preconditions here for efficiency */ \
- /* run-time: this function call is done via a function pointer */ \
- /* so unfortunately does not allow for compiler inlining */ \
- /* optimizations (an alternative using virtual function was also */ \
- /* investigated but also virtual functions cannot be optimized */ \
- /* plus they require virtual table lookups to the alternative */ \
- /* performed worst) */ \
- return BOOST_LOCAL_AUX_call_member(z, defaults_n, ~)(object_ \
- BOOST_PP_COMMA_IF(BOOST_PP_SUB(arity, defaults_n)) \
- BOOST_PP_ENUM_ ## z(BOOST_PP_SUB(arity, defaults_n), \
- BOOST_LOCAL_AUX_arg_name, ~)); \
- }
-
-namespace boost { namespace local { namespace aux {
-
-template<typename F, size_t defaults = 0>
-class function {
- // Empty template cannot be used directly (only via its specializations).
-};
-
-// Iterate within namespace.
-# define BOOST_PP_ITERATION_PARAMS_1 \
- (3, (0, BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX, \
- BOOST_LOCAL_AUX_FILE_FUNCTION_HPP))
-# include BOOST_PP_ITERATE() // Iterate over function arity.
-
-}}} // namespace boost::loca::aux
-
-#undef BOOST_LOCAL_AUX_arg_type
-#undef BOOST_LOCAL_AUX_arg_param_type
-#undef BOOST_LOCAL_AUX_arg_name
-#undef BOOST_LOCAL_AUX_arg
-#undef BOOST_LOCAL_AUX_arg_tparam
-#undef BOOST_LOCAL_AUX_call_ptr
-#undef BOOST_LOCAL_AUX_call_name
-#undef BOOST_LOCAL_AUX_call_member
-#undef BOOST_LOCAL_AUX_call_typedef
-#undef BOOST_LOCAL_AUX_call_param
-#undef BOOST_LOCAL_AUX_call_decl
-#undef BOOST_LOCAL_AUX_call_init
-#undef BOOST_LOCAL_AUX_operator_call
-
-# endif // #include guard
-
-#elif BOOST_PP_ITERATION_DEPTH() == 1
-# define BOOST_LOCAL_AUX_arity BOOST_PP_FRAME_ITERATION(1)
-# define BOOST_PP_ITERATION_PARAMS_2 \
- (3, (0, BOOST_LOCAL_AUX_arity, \
- BOOST_LOCAL_AUX_FILE_FUNCTION_HPP))
-# include BOOST_PP_ITERATE() // Iterate over default params count.
-# undef BOOST_LOCAL_AUX_arity
-
-#elif BOOST_PP_ITERATION_DEPTH() == 2
-# define BOOST_LOCAL_AUX_defaults BOOST_PP_FRAME_ITERATION(2)
-
-// Iterating within namespce boost::local::aux.
-template<typename R
- BOOST_PP_COMMA_IF(BOOST_LOCAL_AUX_arity)
- BOOST_PP_ENUM(BOOST_LOCAL_AUX_arity, BOOST_LOCAL_AUX_arg_tparam, ~)
->
-class function<
- R (BOOST_PP_ENUM(BOOST_LOCAL_AUX_arity, BOOST_LOCAL_AUX_arg_type, ~))
- , BOOST_LOCAL_AUX_defaults
-> {
- // The object type will actually be a local class which cannot be passed as
- // a template parameter so a generic `void*` pointer is used to hold the
- // object (this pointer will then be cased by the call-function implemented
- // by the local class itself). This is the trick used to pass a local
- // function as a template parameter. This trick uses function pointers for
- // the call-functions and function pointers cannot always be optimized by
- // the compiler (they cannot be inlined) thus this trick increased run-time
- // (another trick using virtual functions for the local class was also
- // investigated but also virtual functions cannot be inlined plus they
- // require virtual tables lookups so the virtual functions trick measured
- // worst run-time performance than the function pointer trick).
- typedef void* object_ptr;
- BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_AUX_defaults), // INC for no dflt.
- BOOST_LOCAL_AUX_call_typedef, BOOST_LOCAL_AUX_arity)
-public:
- // run-time: use compiler-generated default constructor, copy constructor,
- // and copy operator (this class only has pointers as member variables and
- // they only need to be copied shallowly so the compiler-generator
- // operations work well) to allow for compiler optimization
-
- // Cannot be private but it should never be used by programmers directly
- // so used internal symbol.
- inline void BOOST_LOCAL_AUX_SYMBOL_INIT_CALL_FUNCTION_NAME(
- object_ptr object,
- BOOST_PP_ENUM(BOOST_PP_INC(BOOST_LOCAL_AUX_defaults), // INC no dflt.
- BOOST_LOCAL_AUX_call_param, ~)
- ) {
- object_ = object;
- BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_AUX_defaults),
- BOOST_LOCAL_AUX_call_init, ~)
- unused_ = 0; // To avoid a GCC uninitialized variable error.
- }
-
- // Result operator(Arg1, ..., ArgN-1, ArgN) -- iff defaults >= 0
- // Result operator(Arg1, ..., ArgN-1) -- iff defaults >= 1
- // ... -- etc
- BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_AUX_defaults), // INC for no dflt.
- BOOST_LOCAL_AUX_operator_call, BOOST_LOCAL_AUX_arity)
-
-private:
- object_ptr object_;
- BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_AUX_defaults), // INC for no dflt.
- BOOST_LOCAL_AUX_call_decl, ~)
-
- // run-time: this unused void* member variable allows for compiler
- // optimizations (at least on MSVC it reduces invocation time of about 50%)
- void* unused_;
-};
-
-# undef BOOST_LOCAL_AUX_defaults
-#endif // iteration
-
Deleted: /sandbox/local_function/boost/local_function/aux_/function_macros/name.hpp
==============================================================================
--- /sandbox/local_function/boost/local_function/aux_/function_macros/name.hpp 2011-12-14 16:26:15 EST (Wed, 14 Dec 2011)
+++ (empty file)
@@ -1,188 +0,0 @@
-
-// Copyright (C) 2009-2011 Lorenzo Caminiti
-// Use, modification, and distribution is subject to 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).
-
-#ifndef BOOST_LOCAL_AUX_FUNCTION_NAME_HPP_
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_HPP_
-
-#include "../preprocessor/keyword/recursive.hpp"
-#include "../symbol.hpp"
-#include "../config.hpp"
-// For BOOST_TYPEOF.
-#include "../scope_exit/scope_exit.hpp" // Use this lib's ScopeExit impl.
-#include <boost/detail/preprocessor/keyword/inline.hpp>
-#include <boost/preprocessor/control/iif.hpp>
-#include <boost/preprocessor/control/expr_iif.hpp>
-#include <boost/preprocessor/logical/bitor.hpp>
-#include <boost/preprocessor/tuple/eat.hpp>
-
-// PRIVATE //
-
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_INIT_RECURSION_FUNC_ \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(init_recursion)
-
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_RECURSIVE_FUNC_( \
- is_recursive, local_function_name) \
- BOOST_PP_IIF(is_recursive, \
- local_function_name \
- , \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(nonrecursive_local_function_name) \
- )
-
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_END_LOCAL_FUNCTOR_(id, \
- 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 */ \
- /* `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 */ \
- BOOST_LOCAL_AUX_SYMBOL_FUNCTOR_TYPE \
- BOOST_LOCAL_AUX_FUNCTION_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_AUX_FUNCTION_NAME_INIT_RECURSION_FUNC_( \
- BOOST_LOCAL_AUX_SYMBOL_FUNCTOR_TYPE& functor) { \
- local_function_name = functor; \
- } \
- ) \
- /* local functor can be passed as tparam only on C++11 (faster) */ \
- } local_functor_name(BOOST_LOCAL_AUX_SYMBOL_ARGS_VARIABLE_NAME.value); \
- /* non-local functor can always be passed as tparam (but slower) */ \
- BOOST_TYPEOF(local_functor_name. \
- BOOST_LOCAL_AUX_FUNCTION_NAME_RECURSIVE_FUNC_(is_recursive, \
- local_function_name)) \
- nonlocal_functor_name; \
- /* 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 */ \
- local_functor_name.BOOST_LOCAL_AUX_SYMBOL_INIT_CALL_FUNCTION_NAME( \
- &local_functor_name, nonlocal_functor_name); \
- BOOST_PP_EXPR_IIF(is_recursive, \
- /* init recursion causes MSVC to not optimize local function not */ \
- /* even when local functor is used as template parameter so no */ \
- /* recursion unless all inlining optimizations are specified off */ \
- local_functor_name.BOOST_LOCAL_AUX_FUNCTION_NAME_INIT_RECURSION_FUNC_( \
- nonlocal_functor_name); \
- )
-
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_FUNCTOR_(local_function_name) \
- BOOST_LOCAL_AUX_INTERNAL_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_AUX_FUNCTION_NAME_(local_function_name) \
- BOOST_LOCAL_AUX_FUNCTION_NAME_END_LOCAL_FUNCTOR_(__LINE__, \
- local_function_name, \
- /* local function is not recursive (because recursion and its */ \
- /* initialization cannot be inlined even on C++11, */ \
- /* so this allows optimization at least on C++11) */ \
- 0 /* not recursive */ , \
- /* local functor */ \
- BOOST_LOCAL_AUX_FUNCTION_NAME_FUNCTOR_(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_AUX_FUNCTION_NAME_INLINE_(local_function_name) \
- BOOST_LOCAL_AUX_FUNCTION_NAME_END_LOCAL_FUNCTOR_(__LINE__, \
- local_function_name, \
- /* inlined local function is never recursive (because recursion */ \
- /* and its initialization cannot be inlined)*/ \
- 0 /* not recursive */ , \
- /* 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_AUX_FUNCTION_NAME_FUNCTOR_(local_function_name))
-
-// 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_AUX_FUNCTION_NAME_RECURSIVE_(local_function_name) \
- BOOST_LOCAL_AUX_FUNCTION_NAME_END_LOCAL_FUNCTOR_(__LINE__, \
- local_function_name, \
- /* recursive local function -- but it cannot be inlined */ \
- 1 /* recursive */ , \
- /* local functor */ \
- BOOST_LOCAL_AUX_FUNCTION_NAME_FUNCTOR_(local_function_name), \
- /* local function declared as non-local functor -- but it can */ \
- /* be inlined only by C++11 */ \
- local_function_name)
-
-// 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_AUX_FUNCTION_NAME_PARSE_INLINE_(qualified_name) \
- BOOST_PP_IIF(BOOST_PP_BITOR( \
- BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS_01, \
- BOOST_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_AUX_FUNCTION_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_AUX_FUNCTION_NAME_ \
- )(BOOST_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT(qualified_name))
-
-// Expand to 1 iff `recursive name` or `recursive inline name` or
-// `inline recursive name`.
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_IS_RECURSIVE_(qualified_name) \
- BOOST_LOCAL_AUX_PP_KEYWORD_IS_RECURSIVE_FRONT( \
- BOOST_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT(qualified_name))
-
-// Revmoes `recursive`, `inline recursive`, and `recursive inline` from front.
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_REMOVE_RECURSIVE_AND_INLINE_( \
- qualified_name) \
- BOOST_LOCAL_AUX_PP_KEYWORD_RECURSIVE_REMOVE_FRONT( \
- BOOST_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT( \
- BOOST_LOCAL_AUX_PP_KEYWORD_RECURSIVE_REMOVE_FRONT( \
- qualified_name \
- )))
-
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_RECURSIVE_REMOVE_(qualified_name) \
- BOOST_PP_IIF(BOOST_LOCAL_AUX_FUNCTION_NAME_IS_RECURSIVE_(qualified_name), \
- BOOST_LOCAL_AUX_FUNCTION_NAME_REMOVE_RECURSIVE_AND_INLINE_ \
- , \
- qualified_name /* might be `name` or `inline name` */ \
- BOOST_PP_TUPLE_EAT(1) \
- )(qualified_name)
-
-// 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_AUX_FUNCTION_NAME_PARSE_RECURSIVE_(qualified_name) \
- BOOST_PP_IIF(BOOST_LOCAL_AUX_FUNCTION_NAME_IS_RECURSIVE_(qualified_name), \
- /* recursion can never be inlined (not even on C++11) */ \
- BOOST_LOCAL_AUX_FUNCTION_NAME_RECURSIVE_ \
- , \
- BOOST_LOCAL_AUX_FUNCTION_NAME_PARSE_INLINE_ \
- )(BOOST_LOCAL_AUX_FUNCTION_NAME_RECURSIVE_REMOVE_(qualified_name))
-
-// PUBLIC //
-
-#define BOOST_LOCAL_AUX_FUNCTION_NAME(qualified_name) \
- BOOST_LOCAL_AUX_FUNCTION_NAME_PARSE_RECURSIVE_(qualified_name)
-
-#endif // #include guard
-
Deleted: /sandbox/local_function/boost/local_function/aux_/function_macros/params.hpp
==============================================================================
--- /sandbox/local_function/boost/local_function/aux_/function_macros/params.hpp 2011-12-14 16:26:15 EST (Wed, 14 Dec 2011)
+++ (empty file)
@@ -1,62 +0,0 @@
-
-// Copyright (C) 2009-2011 Lorenzo Caminiti
-// Use, modification, and distribution is subject to 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).
-
-#ifndef BOOST_LOCAL_AUX_FUNCTION_PARAMS_HPP_
-#define BOOST_LOCAL_AUX_FUNCTION_PARAMS_HPP_
-
-#include "code_/binding.hpp"
-#include "code_/functor.hpp"
-#include "code_/deduce_result_type.hpp"
-#include "../symbol.hpp"
-#include "../scope_exit/scope_exit.hpp" // Use this lib's ScopeExit impl.
-#include "../preprocessor/sign/parse_params.hpp"
-#include "../preprocessor/sign/params_error.hpp"
-#include <boost/mpl/assert.hpp>
-#include <boost/preprocessor/control/iif.hpp>
-
-// Undefine local function bound args global variable. Actual declaration of
-// this variable is made using SFINAE mechanisms by each local function macro.
-extern boost::scope_exit::aux::undeclared
- BOOST_LOCAL_AUX_SYMBOL_ARGS_VARIABLE_NAME;
-
-// PRIVATE //
-
-#define BOOST_LOCAL_AUX_FUNCTION_PARAMS_TYPENAME_KEYWORD_(is_template) \
- BOOST_PP_IIF(is_template, BOOST_PP_IDENTITY(typename), BOOST_PP_EMPTY)()
-
-#define BOOST_LOCAL_AUX_FUNCTION_PARAMS_OK_(sign_params, id, is_template) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING(sign_params, id, \
- BOOST_LOCAL_AUX_FUNCTION_PARAMS_TYPENAME_KEYWORD_(is_template)) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR(sign_params, id, \
- BOOST_LOCAL_AUX_FUNCTION_PARAMS_TYPENAME_KEYWORD_(is_template))
-
-#define BOOST_LOCAL_AUX_FUNCTION_PARAMS_ERROR_(sign_params, id, is_template) \
- ; /* close eventual previous statements, otherwise it has no effect */ \
- BOOST_MPL_ASSERT_MSG(false, /* always fails (there's an error) */ \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_ERROR_MSG(sign_params), ()) \
- ; /* must close ASSERT macro for eventual use within class scope */
-
-// sign_params: parsed parenthesized params.
-#define BOOST_LOCAL_AUX_FUNCTION_PARAMS_(sign_params, id, is_template) \
- /* this must follow the result type (this code must be always present */ \
- /* even if there's an error because result type always present) */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_DEDUCE_RESULT_TYPE(id, is_template) \
- /* rest of the code */ \
- BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_SIGN_PARAMS_HAVE_ERROR(sign_params), \
- BOOST_LOCAL_AUX_FUNCTION_PARAMS_ERROR_ \
- , \
- BOOST_LOCAL_AUX_FUNCTION_PARAMS_OK_ \
- )(sign_params, id, is_template)
-
-// PUBLIC //
-
-#define BOOST_LOCAL_AUX_FUNCTION_PARAMS(parenthesized_params, id, is_template) \
- BOOST_LOCAL_AUX_FUNCTION_PARAMS_( \
- BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS(parenthesized_params), \
- id, is_template)
-
-#endif // #include guard
-
Deleted: sandbox/local_function/boost/local_function/aux_/overload_base.hpp
==============================================================================
--- sandbox/local_function/boost/local_function/aux_/overload_base.hpp 2011-12-14 16:26:15 EST (Wed, 14 Dec 2011)
+++ (empty file)
@@ -1,85 +0,0 @@
-
-// Copyright (C) 2009-2011 Lorenzo Caminiti
-// Use, modification, and distribution is subject to 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).
-
-#if !BOOST_PP_IS_ITERATING
-# ifndef BOOST_LOCAL_AUX_OVERLOAD_BASE_HPP_
-# define BOOST_LOCAL_AUX_OVERLOAD_BASE_HPP_
-
-# include "file.hpp"
-# include "../config.hpp"
-# include <boost/function.hpp>
-# include <boost/preprocessor/iteration/iterate.hpp>
-# include <boost/preprocessor/repetition/enum.hpp>
-# include <boost/preprocessor/cat.hpp>
-# include <boost/preprocessor/comma_if.hpp>
-
-#define BOOST_LOCAL_AUX_arg_type(z, n, unused) \
- BOOST_PP_CAT(A, n)
-
-#define BOOST_LOCAL_AUX_arg_name(z, n, unused) \
- BOOST_PP_CAT(a, n)
-
-#define BOOST_LOCAL_AUX_arg_tparam(z, n, unused) \
- typename BOOST_LOCAL_AUX_arg_type(z, n, unused)
-
-#define BOOST_LOCAL_AUX_arg(z, n, unused) \
- BOOST_LOCAL_AUX_arg_type(z, n, unused) \
- BOOST_LOCAL_AUX_arg_name(z, n, unused)
-
-#define BOOST_LOCAL_AUX_f \
- R (BOOST_PP_ENUM(BOOST_LOCAL_AUX_arity, BOOST_LOCAL_AUX_arg_type, ~))
-
-namespace boost { namespace local { namespace aux {
-
-template<typename F>
-class overload_base {
- // Empty template cannot be used directly (only via its specializations).
-};
-
-# define BOOST_PP_ITERATION_PARAMS_1 \
- (3, (0, BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX, \
- BOOST_LOCAL_AUX_FILE_OVERLOAD_BASE_HPP))
-# include BOOST_PP_ITERATE() // Iterate over funciton arity.
-
-}}} // namespace boost::local::aux
-
-#undef BOOST_LOCAL_AUX_arg_type
-#undef BOOST_LOCAL_AUX_arg_name
-#undef BOOST_LOCAL_AUX_arg_tparam
-#undef BOOST_LOCAL_AUX_arg
-#undef BOOST_LOCAL_AUX_f
-
-# endif // #include guard
-
-#elif BOOST_PP_ITERATION_DEPTH() == 1
-# define BOOST_LOCAL_AUX_arity BOOST_PP_FRAME_ITERATION(1)
-
-// Iterating within namespace boost::local::aux.
-template<typename R
- BOOST_PP_COMMA_IF(BOOST_LOCAL_AUX_arity)
- BOOST_PP_ENUM(BOOST_LOCAL_AUX_arity, BOOST_LOCAL_AUX_arg_tparam, ~)
->
-class overload_base<BOOST_LOCAL_AUX_f> {
-public:
- /* implicit */ inline overload_base(
- // This requires specified type to be implicitly convertible to
- // a boost::function<> functor.
- ::boost::function<BOOST_LOCAL_AUX_f> const& f): f_(f)
- {}
-
- inline R operator()(BOOST_PP_ENUM(BOOST_LOCAL_AUX_arity,
- BOOST_LOCAL_AUX_arg, ~)) const {
- return f_(BOOST_PP_ENUM(BOOST_LOCAL_AUX_arity,
- BOOST_LOCAL_AUX_arg_name, ~));
- }
-
-private:
- ::boost::function<BOOST_LOCAL_AUX_f> const f_;
-};
-
-# undef BOOST_LOCAL_AUx_arity
-#endif // iteration
-
Deleted: sandbox/local_function/boost/local_function/block.hpp
==============================================================================
--- sandbox/local_function/boost/local_function/block.hpp 2011-12-14 16:26:15 EST (Wed, 14 Dec 2011)
+++ (empty file)
@@ -1,162 +0,0 @@
-
-// Copyright (C) 2009-2011 Lorenzo Caminiti
-// Use, modification, and distribution is subject to 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).
-
-/** @file
- * @brief Local blocks allow to program code that is executed "in place" while
- * accessing some of the variables in scope as constants.
- */
-
-#ifndef BOOST_LOCAL_BLOCK_HPP_
-#define BOOST_LOCAL_BLOCK_HPP_
-
-#include "config.hpp"
-#include "function.hpp"
-#include "aux_/block.hpp"
-#include <boost/config.hpp> // For variadic macros.
-
-#if defined(BOOST_NO_VARIADIC_MACROS) || defined(BOOST_LOCAL_CONFIG_COMPLIANT)
-
-/**
- * @brief This macro starts the declaration of a local block.
- *
- * This macro must be used within a declarative context, it must be followed by
- * the local block body code and then by the @RefMacro{BOOST_LOCAL_BLOCK_END}
- * macro (see the @RefSect{Tutorial} section):
- * @code
- * { // Some declarative context.
- * ...
- * BOOST_LOCAL_BLOCK(bindings) {
- * ... // Body code.
- * } BOOST_LOCAL_BLOCK_END
- * ...
- * }
- * @endcode
- *
- * As usual, exceptions specifications can be optionally programmed before the
- * body code block (but the specifications will only apply the body code and
- * not to the library code automatically generated by the macro expansion,
- * see @RefSect2{Advanced_Topics, Advanced Topics}).
- *
- * Within templates, the special macro @RefMacro{BOOST_LOCAL_BLOCK_TPL} must be
- * used instead of @RefMacro{BOOST_LOCAL_BLOCK}.
- *
- * @Note A <c>return;</c> instruction from within a local block body jumps to
- * the end of the local block body and it does not return the enclosing scope.
- *
- * @Params
- * @Param{bindings,
- * On all C++ compilers\, the <em>sequencing macro syntax</em> defined by the
- * following grammar is used to specify the variables in scope to bind:
- * @code
- * bindings:
- * void_list | bound_list
- * void_list:
- * (void)
- * bound_list:
- * (bound_parameter1) (bound_parameter2) ...
- * bound_parameter:
- * [const] bind [(variable_type)] [&] variable_name
- * @endcode
- * Where the following lexical conventions have been used:
- * <c>token1 | token2</c> means either <c>token1</c> or <c>token2</c>;
- * <c>[token]</c> means either <c>token</c> or nothing (i.e.\, <c>token</c> is
- * optional).
- *
- * On C99 and later compilers that support variadic macros\, the above
- * grammar can be modified as follow to define the <em>variadic macro
- * syntax</em> that can also be used to specify the variables in scope to
- * bind:
- * @code
- * void_list:
- * void
- * bound_list:
- * bound_parameter1\, bound_parameter2\, ...
- * @endcode
- * Note that the variadic macro syntax uses commas <c>\,</c> instead of
- * parenthesis <c>()</c> to separate the parameters and therefore resembles
- * the usual C++ function parameter declaration syntax more closely than the
- * sequencing macro syntax. However\, the variadic macro syntax will only work
- * on C++ compilers that support variadic macros so it should be used with
- * care in order to avoid portability issues.
- *
- * Finally\, on C++ compilers that support empty macro parameters\, the above
- * grammars can be modified as follow to define the <em>empty macro
- * syntax</em> that can also be used to specify an empty list of variables to
- * bind:
- * @code
- * void_list:
- * ()
- * @endcode
- * Note that the empty macro parameter syntax uses the usual C++ syntax to
- * specify empty bound variable list but it will only work on compilers
- * that support empty macro parameters so it should be used with care in order
- * to avoid portability issues.
- * }
- * @EndParams
- *
- * When the object <c>this</c> is specified as the name of the variable to
- * bind, the body must use the special name <c>this_</c> to access the bound
- * object.
- * The special name <c>this_</c> is defined by the configuration macro
- * @RefMacro{BOOST_LOCAL_CONFIG_THIS_PARAM_NAME}.
- *
- * Both the variadic and empty macro syntaxes are always disabled when the
- * configuration macro @RefMacro{BOOST_LOCAL_CONFIG_COMPLIANT} is defined.
- *
- * @Note This macro cannot be used multiple times on the same line because it
- * internally uses the line number <c>__LINE__</c> to generate unique
- * identifiers.
- *
- * @See @RefSect{Tutorial} section, @RefSect2{Advanced_Topics, Advanced Topics}
- * section, @RefMacro{BOOST_LOCAL_BLOCK_TPL},
- * @RefMacro{BOOST_LOCAL_BLOCK_END},
- * @RefMacro{BOOST_LOCAL_CONFIG_THIS_PARAM_NAME},
- * @RefMacro{BOOST_LOCAL_CONFIG_COMPLIANT}.
- */
-#define BOOST_LOCAL_BLOCK(bindings) \
- BOOST_LOCAL_AUX_BLOCK(BOOST_LOCAL_FUNCTION_PARAMS, bindings)
-/**
- * @brief This macro is the same as @RefMacro{BOOST_LOCAL_BLOCK} but
- * it must be used when declaring local blocks within templates.
- *
- * @See @RefMacro{BOOST_LOCAL_BLOCK}, @RefSect{Tutorial} section.
- */
-#define BOOST_LOCAL_BLOCK_TPL(bindings) \
- BOOST_LOCAL_AUX_BLOCK(BOOST_LOCAL_FUNCTION_PARAMS_TPL, bindings)
-
-#else // BOOST_NO_VARIADIC_MACROS
-
-#include "aux_/preprocessor/variadic/to_seq.hpp"
-
-#define BOOST_LOCAL_BLOCK(...) \
- BOOST_LOCAL_AUX_BLOCK(BOOST_LOCAL_FUNCTION_PARAMS, \
- BOOST_LOCAL_AUX_PP_VARIADIC_TO_SEQ( \
- (void) /* for empty seq */, __VA_ARGS__))
-
-#define BOOST_LOCAL_BLOCK_TPL(...) \
- BOOST_LOCAL_AUX_BLOCK(BOOST_LOCAL_FUNCTION_PARAMS_TPL, \
- BOOST_LOCAL_AUX_PP_VARIADIC_TO_SEQ( \
- (void) /* for empty seq */, __VA_ARGS__))
-
-#endif // BOOST_NO_VARIADIC_MACROS
-
-/**
- * @brief This macro ends the definition of a local block.
- *
- * This macro must follow the local block body code <c>{ ... }</c> as
- * shown in the @RefMacro{BOOST_LOCAL_BLOCK} documentation.
- *
- * @Note This macro cannot be used multiple times on the same line because it
- * internally uses the line number <c>__LINE__</c> to generate unique
- * identifiers.
- *
- * @See @RefMacro{BOOST_LOCAL_BLOCK}, @RefSect{Tutorial} section.
- */
-#define BOOST_LOCAL_BLOCK_END \
- BOOST_LOCAL_AUX_BLOCK_END(__LINE__)
-
-#endif // #include guard
-
Deleted: sandbox/local_function/boost/local_function/exit.hpp
==============================================================================
--- sandbox/local_function/boost/local_function/exit.hpp 2011-12-14 16:26:15 EST (Wed, 14 Dec 2011)
+++ (empty file)
@@ -1,164 +0,0 @@
-
-// Copyright (C) 2009-2011 Lorenzo Caminiti
-// Use, modification, and distribution is subject to 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).
-
-/** @file
- * @brief Local exits allow to program code that is executed when the enclosing
- * scope is exited.
- */
-
-#ifndef BOOST_LOCAL_EXIT_HPP_
-#define BOOST_LOCAL_EXIT_HPP_
-
-#include "config.hpp"
-#include "function.hpp"
-#include "aux_/exit.hpp"
-#include <boost/config.hpp> // For variadic macros.
-
-#if defined(BOOST_NO_VARIADIC_MACROS) || defined(BOOST_LOCAL_CONFIG_COMPLIANT)
-
-/**
- * @brief This macro starts the declaration of a local exit.
- *
- * This macro must be used within a declarative context, it must be followed by
- * the local exit body code and then by the @RefMacro{BOOST_LOCAL_EXIT_END}
- * macro (see the @RefSect{Tutorial} section):
- * @code
- * { // Some declarative context.
- * ...
- * BOOST_LOCAL_EXIT(bindings) {
- * ... // Body code.
- * } BOOST_LOCAL_EXIT_END
- * ...
- * }
- * @endcode
- *
- * The execution of the local exit body code is guaranteed only if the program
- * does not terminate because of an uncaught exception.
- * As usual, exceptions specifications can be optionally programmed before the
- * body code block (but the specifications will only apply the body code and
- * not to the library code automatically generated by the macro expansion,
- * see @RefSect2{Advanced_Topics, Advanced Topics}).
- *
- * Within templates, the special macro @RefMacro{BOOST_LOCAL_EXIT_TPL} must be
- * used instead of @RefMacro{BOOST_LOCAL_EXIT}.
- *
- * @Note A <c>return;</c> instruction from within a local exit body jumps to
- * the end of the local exit body and it does not return the enclosing scope.
- *
- * @Params
- * @Param{bindings,
- * On all C++ compilers\, the <em>sequencing macro syntax</em> defined by the
- * following grammar is used to specify the variables in scope to bind:
- * @code
- * bindings:
- * void_list | bound_list
- * void_list:
- * (void)
- * bound_list:
- * (bound_parameter1) (bound_parameter2) ...
- * bound_parameter:
- * [const] bind [(variable_type)] [&] variable_name
- * @endcode
- * Where the following lexical conventions have been used:
- * <c>token1 | token2</c> means either <c>token1</c> or <c>token2</c>;
- * <c>[token]</c> means either <c>token</c> or nothing (i.e.\, <c>token</c> is
- * optional).
- *
- * On C99 and later compilers that support variadic macros\, the above
- * grammar can be modified as follow to define the <em>variadic macro
- * syntax</em> that can also be used to specify the variables in scope to
- * bind:
- * @code
- * void_list:
- * void
- * bound_list:
- * bound_parameter1\, bound_parameter2\, ...
- * @endcode
- * Note that the variadic macro syntax uses commas <c>\,</c> instead of
- * parenthesis <c>()</c> to separate the parameters and therefore resembles
- * the usual C++ function parameter declaration syntax more closely than the
- * sequencing macro syntax. However\, the variadic macro syntax will only work
- * on C++ compilers that support variadic macros so it should be used with
- * care in order to avoid portability issues.
- *
- * Finally\, on C++ compilers that support empty macro parameters\, the above
- * grammars can be modified as follow to define the <em>empty macro
- * syntax</em> that can can also be used to specify an empty list of variables
- * to bind:
- * @code
- * void_list:
- * ()
- * @endcode
- * Note that the empty macro parameter syntax uses the usual C++ syntax to
- * specify empty bound variable list but it will only work on compilers
- * that support empty macro parameters so it should be used with care in order
- * to avoid portability issues.
- * }
- * @EndParams
- *
- * When the object <c>this</c> is specified as the name of the variable to
- * bind, the body must use the special name <c>this_</c> to access the bound
- * object.
- * The special name <c>this_</c> is defined by the configuration macro
- * @RefMacro{BOOST_LOCAL_CONFIG_THIS_PARAM_NAME}.
- *
- * Both the variadic and empty macro syntaxes are always disabled when the
- * configuration macro @RefMacro{BOOST_LOCAL_CONFIG_COMPLIANT} is defined.
- *
- * @Note This macro cannot be used multiple times on the same line because it
- * internally uses the line number <c>__LINE__</c> to generate unique
- * identifiers.
- *
- * @See @RefSect{Tutorial} section, @RefSect2{Advanced_Topics, Advanced Topics}
- * section, @RefMacro{BOOST_LOCAL_EXIT_TPL}, @RefMacro{BOOST_LOCAL_EXIT_END},
- * @RefMacro{BOOST_LOCAL_CONFIG_THIS_PARAM_NAME},
- * @RefMacro{BOOST_LOCAL_CONFIG_COMPLIANT}.
- */
-#define BOOST_LOCAL_EXIT(binding_list) \
- BOOST_LOCAL_AUX_EXIT(BOOST_LOCAL_FUNCTION_PARAMS, binding_list)
-
-/**
- * @brief This macro is the same as @RefMacro{BOOST_LOCAL_EXIT} but
- * it must used when declaring local exits within templates.
- *
- * @See @RefMacro{BOOST_LOCAL_EXIT}, @RefSect{Tutorial} section.
- */
-#define BOOST_LOCAL_EXIT_TPL(binding_list) \
- BOOST_LOCAL_AUX_EXIT(BOOST_LOCAL_FUNCTION_PARAMS_TPL, binding_list)
-
-#else // BOOST_NO_VARIADIC_MACROS
-
-#include "aux_/preprocessor/variadic/to_seq.hpp"
-
-#define BOOST_LOCAL_EXIT(...) \
- BOOST_LOCAL_AUX_EXIT(BOOST_LOCAL_FUNCTION_PARAMS, \
- BOOST_LOCAL_AUX_PP_VARIADIC_TO_SEQ( \
- (void) /* for empty seq */, __VA_ARGS__))
-
-#define BOOST_LOCAL_EXIT_TPL(...) \
- BOOST_LOCAL_AUX_EXIT(BOOST_LOCAL_FUNCTION_PARAMS_TPL, \
- BOOST_LOCAL_AUX_PP_VARIADIC_TO_SEQ( \
- (void) /* for empty seq */, __VA_ARGS__))
-
-#endif // BOOST_NO_VARIADIC_MACROS
-
-/**
- * @brief This macro ends the definition of a local exit.
- *
- * This macro must follow the local exit body code <c>{ ... }</c> as
- * shown in the @RefMacro{BOOST_LOCAL_EXIT} documentation.
- *
- * @Note This macro cannot be used multiple times on the same line because it
- * internally uses the line number <c>__LINE__</c> to generate unique
- * identifiers.
- *
- * @See @RefMacro{BOOST_LOCAL_EXIT}, @RefSect{Tutorial} section.
- */
-#define BOOST_LOCAL_EXIT_END \
- BOOST_LOCAL_AUX_EXIT_END(__LINE__)
-
-#endif // #include guard
-
Deleted: sandbox/local_function/boost/local_function/typeof.hpp
==============================================================================
--- sandbox/local_function/boost/local_function/typeof.hpp 2011-12-14 16:26:15 EST (Wed, 14 Dec 2011)
+++ (empty file)
@@ -1,56 +0,0 @@
-
-// Copyright (C) 2009-2011 Lorenzo Caminiti
-// Use, modification, and distribution is subject to 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).
-
-/** @file
- * @brief Deduce the type of variables that are bound to local functions,
- * local blocks, and local exits.
- */
-
-#ifndef BOOST_LOCAL_TYPEOF_HPP_
-#define BOOST_LOCAL_TYPEOF_HPP_
-
-#include "aux_/symbol.hpp"
-
-// Bound variable name. Expand to qualified bound type (i.e., bound variable
-// type with extra const and/or & for const and/or reference binds).
-// Can be used with local functions, blocks, and exits. It accepts `this`.
-/**
- * @brief This macro expands to the fully qualified type of a variable bound
- * to to local functions, local blocks, and local exits.
- *
- * The type is fully qualified in that it contains the extra constant and
- * reference qualifiers when they are specified for binding by constant and by
- * reference.
- * For example, if a variable named <c>t</c> of type <c>T</c> is:
- * @li Bound by value using <c>bind t</c> then
- * <c>BOOST_LOCAL_TYPEOF(t)</c> is <c>T</c>.
- * @li Bound by constant value using <c>const bind t</c>
- * then <c>BOOST_LOCAL_TYPEOF(t)</c> is <c>const T</c>.
- * @li Bound by reference using <c>bind& t</c>
- * then <c>BOOST_LOCAL_TYPEOF(t)</c> is <c>T&</c>.
- * @li Bound by constant reference using <c>const bind& t</c>
- * then <c>BOOST_LOCAL_TYPEOF(t)</c> is <c>const T&</c>.
- *
- * Within local functions, local blocks, and local exits, this macro can be
- * used to deduce the bound variable types to declare local variables, check
- * concepts (using Boost.ConceptCheck), etc (see @RefSect2{Advanced_Topics,
- * Advanced Topics} section).
- *
- * @Params
- * @Param{bound_variable_name,
- * The name of the bound variable for which the type is being deduced.
- * }
- * @EndParams
- *
- * @See @RefMacro{BOOST_LOCAL_FUNCTION_PARAMS}, @RefMacro{BOOST_LOCAL_BLOCK},
- * @RefMacro{BOOST_LOCAL_EXIT}, @RefSect2{Advanced_Topics, Advanced Topics}
- * section.
- */
-#define BOOST_LOCAL_TYPEOF(bound_variable_name) \
- BOOST_LOCAL_AUX_SYMBOL_TYPEOF_TYPE(bound_variable_name)
-
-#endif // #include guard
-
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