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 a snapshot of the master branch, built from commit e31e3ddd05.
PrevUpHomeNext

config_from_env

Configures an execution context by reading environment variables.

class config_from_env :
  public execution_context::service_maker
Member Functions

Name

Description

config_from_env [constructor]

Construct with the default prefix "asio".

Construct with a specified prefix.

make

Add a concrete service to the specified execution context.

The environment variable names are formed by concatenating the prefix, section, and key, with underscore as delimiter, and then converting the resulting string to upper case.

Example
boost::asio::io_context my_io_context{
   boost::asio::config_from_env{"my_app"}};
Requirements

Header: boost/asio/config.hpp

Convenience header: boost/asio.hpp


PrevUpHomeNext