/
usr
/
include
/
boost
/
/usr/include/boost
mkdir
upload
Name
Size
Mode
Actions
accumulators/
-
0755
rm
algorithm/
-
0755
rm
align/
-
0755
rm
archive/
-
0755
rm
asio/
-
0755
rm
assert/
-
0755
rm
assign/
-
0755
rm
atomic/
-
0755
rm
beast/
-
0755
rm
bimap/
-
0755
rm
bind/
-
0755
rm
callable_traits/
-
0755
rm
chrono/
-
0755
rm
circular_buffer/
-
0755
rm
compatibility/
-
0755
rm
compute/
-
0755
rm
concept/
-
0755
rm
concept_check/
-
0755
rm
config/
-
0755
rm
container/
-
0755
rm
container_hash/
-
0755
rm
context/
-
0755
rm
contract/
-
0755
rm
convert/
-
0755
rm
core/
-
0755
rm
coroutine/
-
0755
rm
coroutine2/
-
0755
rm
date_time/
-
0755
rm
detail/
-
0755
rm
dll/
-
0755
rm
dynamic_bitset/
-
0755
rm
endian/
-
0755
rm
exception/
-
0755
rm
fiber/
-
0755
rm
filesystem/
-
0755
rm
flyweight/
-
0755
rm
format/
-
0755
rm
function/
-
0755
rm
functional/
-
0755
rm
function_types/
-
0755
rm
fusion/
-
0755
rm
geometry/
-
0755
rm
gil/
-
0755
rm
graph/
-
0755
rm
hana/
-
0755
rm
heap/
-
0755
rm
histogram/
-
0755
rm
hof/
-
0755
rm
icl/
-
0755
rm
integer/
-
0755
rm
interprocess/
-
0755
rm
intrusive/
-
0755
rm
io/
-
0755
rm
iostreams/
-
0755
rm
iterator/
-
0755
rm
lambda/
-
0755
rm
lexical_cast/
-
0755
rm
locale/
-
0755
rm
local_function/
-
0755
rm
lockfree/
-
0755
rm
log/
-
0755
rm
logic/
-
0755
rm
math/
-
0755
rm
metaparse/
-
0755
rm
move/
-
0755
rm
mp11/
-
0755
rm
mpi/
-
0755
rm
mpl/
-
0755
rm
msm/
-
0755
rm
multiprecision/
-
0755
rm
multi_array/
-
0755
rm
multi_index/
-
0755
rm
nowide/
-
0755
rm
numeric/
-
0755
rm
optional/
-
0755
rm
outcome/
-
0755
rm
parameter/
-
0755
rm
pending/
-
0755
rm
phoenix/
-
0755
rm
polygon/
-
0755
rm
poly_collection/
-
0755
rm
pool/
-
0755
rm
predef/
-
0755
rm
preprocessor/
-
0755
rm
process/
-
0755
rm
program_options/
-
0755
rm
property_map/
-
0755
rm
property_tree/
-
0755
rm
proto/
-
0755
rm
ptr_container/
-
0755
rm
python/
-
0755
rm
qvm/
-
0755
rm
random/
-
0755
rm
range/
-
0755
rm
ratio/
-
0755
rm
regex/
-
0755
rm
safe_numerics/
-
0755
rm
serialization/
-
0755
rm
signals2/
-
0755
rm
smart_ptr/
-
0755
rm
sort/
-
0755
rm
spirit/
-
0755
rm
stacktrace/
-
0755
rm
statechart/
-
0755
rm
static_string/
-
0755
rm
stl_interfaces/
-
0755
rm
system/
-
0755
rm
test/
-
0755
rm
thread/
-
0755
rm
timer/
-
0755
rm
tti/
-
0755
rm
tuple/
-
0755
rm
typeof/
-
0755
rm
type_erasure/
-
0755
rm
type_index/
-
0755
rm
type_traits/
-
0755
rm
units/
-
0755
rm
unordered/
-
0755
rm
utility/
-
0755
rm
uuid/
-
0755
rm
variant/
-
0755
rm
variant2/
-
0755
rm
vmd/
-
0755
rm
wave/
-
0755
rm
winapi/
-
0755
rm
xpressive/
-
0755
rm
yap/
-
0755
rm
align.hpp
633
0644
edit
dl
rm
aligned_storage.hpp
653
0644
edit
dl
rm
any.hpp
9472
0644
edit
dl
rm
array.hpp
15827
0644
edit
dl
rm
asio.hpp
7472
0644
edit
dl
rm
assert.hpp
2625
0644
edit
dl
rm
assign.hpp
592
0644
edit
dl
rm
atomic.hpp
754
0644
edit
dl
rm
beast.hpp
591
0644
edit
dl
rm
bimap.hpp
387
0644
edit
dl
rm
bind.hpp
1809
0644
edit
dl
rm
blank.hpp
1985
0644
edit
dl
rm
blank_fwd.hpp
618
0644
edit
dl
rm
callable_traits.hpp
2138
0644
edit
dl
rm
call_traits.hpp
633
0644
edit
dl
rm
cast.hpp
584
0644
edit
dl
rm
cerrno.hpp
4187
0644
edit
dl
rm
checked_delete.hpp
414
0644
edit
dl
rm
chrono.hpp
706
0644
edit
dl
rm
circular_buffer.hpp
1946
0644
edit
dl
rm
circular_buffer_fwd.hpp
1137
0644
edit
dl
rm
compressed_pair.hpp
653
0644
edit
dl
rm
compute.hpp
1523
0644
edit
dl
rm
concept_archetype.hpp
23725
0644
edit
dl
rm
concept_check.hpp
31977
0644
edit
dl
rm
config.hpp
2216
0644
edit
dl
rm
contract.hpp
1842
0644
edit
dl
rm
contract_macro.hpp
56497
0644
edit
dl
rm
convert.hpp
7402
0644
edit
dl
rm
crc.hpp
94883
0644
edit
dl
rm
cregex.hpp
721
0644
edit
dl
rm
cstdfloat.hpp
2611
0644
edit
dl
rm
cstdint.hpp
18497
0644
edit
dl
rm
cstdlib.hpp
1739
0644
edit
dl
rm
current_function.hpp
1681
0644
edit
dl
rm
cxx11_char_types.hpp
4160
0644
edit
dl
rm
date_time.hpp
540
0644
edit
dl
rm
dll.hpp
712
0644
edit
dl
rm
dynamic_bitset.hpp
560
0644
edit
dl
rm
dynamic_bitset_fwd.hpp
675
0644
edit
dl
rm
enable_shared_from_this.hpp
525
0644
edit
dl
rm
endian.hpp
364
0644
edit
dl
rm
exception_ptr.hpp
396
0644
edit
dl
rm
filesystem.hpp
862
0644
edit
dl
rm
flyweight.hpp
604
0644
edit
dl
rm
foreach.hpp
45551
0644
edit
dl
rm
foreach_fwd.hpp
1702
0644
edit
dl
rm
format.hpp
2179
0644
edit
dl
rm
function.hpp
2524
0644
edit
dl
rm
functional.hpp
20124
0644
edit
dl
rm
function_equal.hpp
791
0644
edit
dl
rm
function_output_iterator.hpp
630
0644
edit
dl
rm
generator_iterator.hpp
2028
0644
edit
dl
rm
geometry.hpp
704
0644
edit
dl
rm
get_pointer.hpp
2288
0644
edit
dl
rm
gil.hpp
1697
0644
edit
dl
rm
hana.hpp
6807
0644
edit
dl
rm
histogram.hpp
1312
0644
edit
dl
rm
hof.hpp
2009
0644
edit
dl
rm
implicit_cast.hpp
810
0644
edit
dl
rm
indirect_reference.hpp
1036
0644
edit
dl
rm
integer.hpp
11593
0644
edit
dl
rm
integer_fwd.hpp
5181
0644
edit
dl
rm
integer_traits.hpp
8319
0644
edit
dl
rm
intrusive_ptr.hpp
481
0644
edit
dl
rm
io_fwd.hpp
1879
0644
edit
dl
rm
is_placeholder.hpp
634
0644
edit
dl
rm
iterator.hpp
459
0644
edit
dl
rm
iterator_adaptors.hpp
466
0644
edit
dl
rm
lexical_cast.hpp
3275
0644
edit
dl
rm
limits.hpp
6156
0644
edit
dl
rm
locale.hpp
887
0644
edit
dl
rm
local_function.hpp
18858
0644
edit
dl
rm
make_default.hpp
1510
0644
edit
dl
rm
make_shared.hpp
464
0644
edit
dl
rm
make_unique.hpp
293
0644
edit
dl
rm
math_fwd.hpp
975
0644
edit
dl
rm
memory_order.hpp
2457
0644
edit
dl
rm
mem_fn.hpp
596
0644
edit
dl
rm
metaparse.hpp
5281
0644
edit
dl
rm
mp11.hpp
641
0644
edit
dl
rm
mpi.hpp
1101
0644
edit
dl
rm
multi_array.hpp
18021
0644
edit
dl
rm
multi_index_container.hpp
44983
0644
edit
dl
rm
multi_index_container_fwd.hpp
3776
0644
edit
dl
rm
next_prior.hpp
5127
0644
edit
dl
rm
noncopyable.hpp
402
0644
edit
dl
rm
nondet_random.hpp
532
0644
edit
dl
rm
none.hpp
1609
0644
edit
dl
rm
none_t.hpp
953
0644
edit
dl
rm
non_type.hpp
619
0644
edit
dl
rm
operators.hpp
36574
0644
edit
dl
rm
operators_v1.hpp
37735
0644
edit
dl
rm
optional.hpp
528
0644
edit
dl
rm
outcome.hpp
1699
0644
edit
dl
rm
parameter.hpp
1082
0644
edit
dl
rm
phoenix.hpp
476
0644
edit
dl
rm
pointee.hpp
1807
0644
edit
dl
rm
pointer_cast.hpp
3688
0644
edit
dl
rm
pointer_to_other.hpp
1197
0644
edit
dl
rm
polymorphic_cast.hpp
5282
0644
edit
dl
rm
polymorphic_pointer_cast.hpp
2829
0644
edit
dl
rm
predef.h
635
0644
edit
dl
rm
preprocessor.hpp
487
0644
edit
dl
rm
process.hpp
1366
0644
edit
dl
rm
program_options.hpp
820
0644
edit
dl
rm
progress.hpp
5734
0644
edit
dl
rm
python.hpp
2950
0644
edit
dl
rm
random.hpp
3854
0644
edit
dl
rm
range.hpp
603
0644
edit
dl
rm
ratio.hpp
349
0644
edit
dl
rm
rational.hpp
39720
0644
edit
dl
rm
ref.hpp
370
0644
edit
dl
rm
regex.h
2174
0644
edit
dl
rm
regex.hpp
823
0644
edit
dl
rm
regex_fwd.hpp
693
0644
edit
dl
rm
scoped_array.hpp
506
0644
edit
dl
rm
scoped_ptr.hpp
497
0644
edit
dl
rm
scope_exit.hpp
54745
0644
edit
dl
rm
shared_array.hpp
536
0644
edit
dl
rm
shared_container_iterator.hpp
2154
0644
edit
dl
rm
shared_ptr.hpp
525
0644
edit
dl
rm
signals2.hpp
752
0644
edit
dl
rm
smart_ptr.hpp
780
0644
edit
dl
rm
spirit.hpp
1133
0644
edit
dl
rm
stacktrace.hpp
499
0644
edit
dl
rm
static_assert.hpp
7213
0644
edit
dl
rm
static_string.hpp
423
0644
edit
dl
rm
swap.hpp
374
0644
edit
dl
rm
thread.hpp
839
0644
edit
dl
rm
throw_exception.hpp
4328
0644
edit
dl
rm
timer.hpp
2781
0644
edit
dl
rm
tokenizer.hpp
2783
0644
edit
dl
rm
token_functions.hpp
19349
0644
edit
dl
rm
token_iterator.hpp
3810
0644
edit
dl
rm
type.hpp
481
0644
edit
dl
rm
type_index.hpp
10757
0644
edit
dl
rm
type_traits.hpp
7431
0644
edit
dl
rm
unordered_map.hpp
568
0644
edit
dl
rm
unordered_set.hpp
568
0644
edit
dl
rm
utility.hpp
880
0644
edit
dl
rm
variant.hpp
883
0644
edit
dl
rm
version.hpp
1117
0644
edit
dl
rm
visit_each.hpp
690
0644
edit
dl
rm
wave.hpp
944
0644
edit
dl
rm
weak_ptr.hpp
462
0644
edit
dl
rm
Edit:
/usr/include/boost/local_function.hpp
(18858B)
// 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_HPP_ #define BOOST_LOCAL_FUNCTION_HPP_ #ifndef DOXYGEN #include <boost/local_function/aux_/macro/decl.hpp> #include <boost/local_function/aux_/macro/name.hpp> #include <boost/local_function/aux_/macro/typeof.hpp> #include <boost/local_function/aux_/preprocessor/traits/decl.hpp> #include <boost/local_function/detail/preprocessor/line_counter.hpp> #include <boost/local_function/detail/preprocessor/void_list.hpp> #include <boost/config.hpp> // PUBLIC // #ifdef BOOST_NO_CXX11_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_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_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_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_ID_TPL( \ BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, __VA_ARGS__) #endif // VARIADIC #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) // DOCUMENTATION // #else // DOXYGEN /** @file @brief Local functions allow to program functions locally, within other functions, and directly within the scope where they are needed. */ /** @brief This macro is used to start a local function declaration. 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 @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_name) ... } @endcode As usual, exceptions specifications can be optionally programmed just after the 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 @RefSect{advanced_topics, Advanced Topics} section). Within templates, the special macros @RefMacro{BOOST_LOCAL_FUNCTION_TPL} and @RefMacro{BOOST_LOCAL_FUNCTION_NAME_TPL} must be used. @Params @Param{declarations, On compilers that support variadic macros\, the parameter declarations are defined by the following grammar: @code declarations: void | declaration_tuple | declaration_sequence declaration_tuple: declaration\, declaration\, ... declaration_sequence: (declaration) (declaration) ... declaration: bound_variable | parameter | default_value | result_type bound_variable: [const] bind [(variable_type)] [&] variable_name parameter: [auto | register] parameter_type parameter_name default_value: default parameter_default_value result_type: return function_result_type @endcode On compilers that do not support variadic macros\, <c>declaration_tuple</c> cannot be used: @code declarations: void | declaration_sequence @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 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 <c>()</c>. When binding the object <c>this</c>, the special symbol <c>this_</c> needs to be used instead of <c>this</c> as the name of the variable to bind and also within the local function body to access the object. (Mistakenly using <c>this</c> instead of <c>this_</c> might not always result in a compiler error and will in general result in undefined behaviour.) The result type must either be specified just before the macro or within the macro declarations prefixed by <c>return</c> (but not in both places). 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). @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}, @RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX}, @RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS}. */ #define BOOST_LOCAL_FUNCTION(declarations) /** @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 a @RefMacro{BOOST_LOCAL_FUNCTION} (see @RefMacro{BOOST_LOCAL_FUNCTION} 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_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. 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. This macro must follow the local function body code block <c>{ ... }</c>: @code { // Some declarative context. ... result_type BOOST_LOCAL_FUNCTION(declarations) { ... // Body code. } 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 @Param{qualified_name, The name of the local function optionally qualified as follow: @code name: [inline] [recursive] local_function_name @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 The local function name can be qualified by prefixing it with the keyword <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, 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 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_CXX11_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 @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, 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 @RefSect{advanced_topics, Advanced Topics} section). @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_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 @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 the type of a bound variable changes in the enclosing scope, the local function code does not have to change). @Params @Param{bound_variable_name, The name of one of the local function's bound variables. } @EndParams The type returned by the macro is fully qualified in that it contains the extra constant and reference qualifiers when the specified variable is bound 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_FUNCTION_TYPEOF(t)</c> is <c>T</c>. @li Bound by constant value using <c>const bind t</c> then <c>BOOST_LOCAL_FUNCTION_TYPEOF(t)</c> is <c>const T</c>. @li Bound by reference using <c>bind& t</c> then <c>BOOST_LOCAL_FUNCTION_TYPEOF(t)</c> is <c>T&</c>. @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 within templates. @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). @See @RefSect{advanced_topics, Advanced Topics} section, @RefMacro{BOOST_LOCAL_FUNCTION}. */ #define BOOST_LOCAL_FUNCTION_TYPEOF(bound_variable_name) #endif // DOXYGEN #endif // #include guard
Save
cmd:
run