| Home | Libraries | People | FAQ | More

## Struct template env_var

boost::proto::functional::env_var — A unary PolymorphicFunctionObject used for fetching the value associated with a particular key in a transform environment.

## Synopsis

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

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

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

## Description

### `env_var` public member functions

1.     template<typename Env> see-below operator()(Env const & e) const;

   This function behaves as follows:

   - If `Key` is `proto::data_type`:
     - If `proto::is_env<Env>::value` is `true`, return `e[proto::data]`.
     - Otherwise, return `e`.
   - Otherwise, return `e[Key()]`.

   See `proto::env::operator[]` for additional information.