Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Function template let

boost::xpressive::let — For binding local variables to placeholders in semantic actions when constructing a regex_iterator or a regex_token_iterator.

Synopsis

// In header: <boost/xpressive/regex_actions.hpp>


template< ArgBindings>  ( args);

Description

xpressive::let() serves the same purpose as match_results::let(); that is, it binds a placeholder to a local value. The purpose is to allow a regex with semantic actions to be defined that refers to objects that do not yet exist. Rather than referring directly to an object, a semantic action can refer to a placeholder, and the value of the placeholder can be specified later with a let expression. The let expression created with let() is passed to the constructor of either regex_iterator or regex_token_iterator.

See the section "Referring to Non-Local Variables" in the Users' Guide for more discussion.

Example:

// Define a placeholder for a map object:
placeholder<std::map<std::string, int> > sregex sregex_iterator sregex_iterator 

The above code displays:

Parameters:

args

A set of argument bindings, where each argument binding is an assignment expression, the left hand side of which must be an instance of placeholder<X> for some X, and the right hand side is an lvalue of type X.


PrevUpHomeNext