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 as_expr

boost::proto::functional::as_expr — A callable PolymorphicFunctionObject that is equivalent to the proto::as_expr() function.

Synopsis

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

template<typename Domain = proto::default_domain> 
struct as_expr :  proto::callable {
  // member classes/structs/unions
  template<typename This, typename T> 
  struct result<This(T)> :  proto::result_of::as_expr< typename remove_reference< T >::type, Domain >
  {
  };

  // public member functions
  template<typename T> 
    typename proto::result_of::as_expr< T, Domain >::type 
    operator()(T &) const;
  template<typename T> 
    typename proto::result_of::as_expr< T const, Domain >::type 
    operator()(T const &) const;
};

Description

as_expr public member functions

  1. template<typename T> 
      typename proto::result_of::as_expr< T, Domain >::type 
      operator()(T & t) const;

    Wrap an object in a Proto terminal if it isn't a Proto expression already.

    Parameters:

    t

    The object to wrap.

    Returns:

    proto::as_expr<Domain>(t)

  2. template<typename T> 
      typename proto::result_of::as_expr< T const, Domain >::type 
      operator()(T const & t) const;

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


PrevUpHomeNext