Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Macro BOOST_LOCAL_FUNCTION_TPL

BOOST_LOCAL_FUNCTION_TPL — This macro is used to start a local function declaration within templates.

Synopsis

// In header: <boost/local_function.hpp>

BOOST_LOCAL_FUNCTION_TPL(declarations)

Description

This macro must be used instead of BOOST_LOCAL_FUNCTION when declaring a local function within a template. A part from that, this macro has the exact same syntax a BOOST_LOCAL_FUNCTION (see BOOST_LOCAL_FUNCTION for more information):

{ // Some declarative context within a template.
    ...
    result_type BOOST_LOCAL_FUNCTION_TPL(declarations) {
        ... // Body code.
    } BOOST_LOCAL_FUNCTION_NAME_TPL(qualified_name)
    ...
}

Note that BOOST_LOCAL_FUNCTION_NAME_TPL must be used with this macro instead of BOOST_LOCAL_FUNCTION_NAME.

This macro cannot be portably expanded multiple times on the same line. In these cases, use the BOOST_LOCAL_FUNCTION_ID_TPL macro instead.

Note: C++03 does not allow to use typename outside templates. This library internally manipulates types, these operations require typename 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 typename.

See: Tutorial section, BOOST_LOCAL_FUNCTION, BOOST_LOCAL_FUNCTION_ID_TPL, BOOST_LOCAL_FUNCTION_NAME_TPL.


PrevUpHomeNext