Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Struct template function

boost::xpressive::function — A unary metafunction that turns an ordinary function object type into the type of a deferred function object for use in xpressive semantic actions.

Synopsis

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

template<typename PolymorphicFunctionObject> 
struct function {
  // types
  typedef  ;
};

Description

Use xpressive::function<> to turn an ordinary polymorphic function object type into a type that can be used to declare an object for use in xpressive semantic actions.

For example, the global object xpressive::push_back can be used to create deferred actions that have the effect of pushing a value into a container. It is defined with xpressive::function<> as follows:

where op::push_back is an ordinary function object that pushes its second argument into its first. Thus defined, xpressive::push_back can be used in semantic actions as follows:


PrevUpHomeNext