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

PrevUpHomeNext

config_from_string

Configures an execution context by reading variables from a string.

class config_from_string :
  public execution_context::service_maker
Member Functions

Name

Description

config_from_string [constructor]

Construct with the default prefix "asio".

Construct with a specified prefix.

make

Add a concrete service to the specified execution context.

Each variable must be on a line of its own, and of the form:

section.key=value

or, if an optional prefix is specified:

prefix.section.key=value

Blank lines and lines starting with # are ignored. It is also permitted to include a comment starting with # after the value.

Example
boost::asio::io_context my_io_context{
   boost::asio::config_from_string{
     "scheduler.concurrency_hint=10\n"
     "scheduler.locking=1"}};
Requirements

Header: boost/asio/config.hpp

Convenience header: boost/asio.hpp


PrevUpHomeNext