Boost C++ Libraries 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.

Struct as_env

boost::proto::functional::as_env — A unary PolymorphicFunctionObject for ensuring that an object is a transform environment. If it isn't already, it is turned into one such that the object is associated with the proto::data_type key.


// In header: <boost/proto/transform/env.hpp>

struct as_env :  proto::callable {
  // member classes/structs/unions
  template<typename Sig> 
  struct result {
    // types
    typedef see-below type;

  // public member functions
  template<typename T> see-below operator()(T &) const;
  template<typename T> see-below operator()(T const &) const;


as_env public member functions

  1. template<typename T> see-below operator()(T & t) const;
    template<typename T> see-below operator()(T const & t) const;

    If proto::is_env<T>::value is false, this function returns the result of (proto::data = t). See proto::data_type::operator= for details.

    Otherwise, this function returns t by reference.