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

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))


PrevUpHomeNext