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 by_value_generator

boost::proto::by_value_generator — A generator that replaces child nodes held by reference with ones held by value. Use with proto::compose_generators<> to forward that result to another generator.

Synopsis

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


struct by_value_generator :  proto::callable {
  template<typename This, typename Expr> 
  struct result<This(Expr)> {
    // types
    typedef unspecified type;
  };

  // public member functions
  template<typename Expr> unspecified 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::by_value_generator ensures all child nodes are held by value. This generator is typically composed with a second generator for further processing, as proto::compose_generators<proto::by_value_generator, MyGenerator>.

by_value_generator public member functions

  1. template<typename Expr> unspecified operator()(Expr const & expr) const;

    Parameters:

    expr

    A Proto expression.

    Returns:

    Equivalent to proto::deep_copy(expr)


PrevUpHomeNext