| Home | Libraries | People | FAQ | More

## Struct template compose_generators

boost::proto::compose_generators — A composite generator that first applies one transform to an expression and then forwards the result on to another generator for further transformation.

## Synopsis

    // In header: <boost/proto/generate.hpp>

    template<typename First, typename Second>
    struct compose_generators :  proto::callable {
      // member classes/structs/unions
      template<typename This, typename Expr>
      struct result<This(Expr)> :
        boost::result_of<
          Second(typename boost::result_of<First(Expr)>::type)
        >
      {
      };

      // public member functions
      template<typename Expr>
        typename boost::result_of<
          Second(typename boost::result_of<First(Expr)>::type)
        >::type
        operator()(Expr const &) const;
    };

## Description

Generators are intended for use as the first template parameter to the `proto::domain<>` class template and control if and how expressions within that domain are to be customized. `proto::compose_generators<>` is a composite generator that first applies one transform to an expression and then forwards the result on to another generator for further transformation.

### `compose_generators` public member functions

1.     template<typename Expr>
         typename boost::result_of<
             Second(typename boost::result_of<First(Expr)>::type)
           >::type
         operator()(Expr const & expr) const;

   Parameters:

   `expr` | A Proto expression.

   Returns: | `Second()(First()(expr))`