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 for the latest Boost documentation.

Class variables_map

boost::program_options::variables_map —


class variables_map
  :  : public boost::program_options::abstract_variables_map
// construct/copy/destruct
variables_map(const abstract_variables_map *);

// public member functions
const variable_value & operator[](const std::string &) const;

// private member functions
const variable_value & get(const std::string &) const;


Concrete variables map which store variables in real map.

variables_map construct/copy/destruct

  1. variables_map();
  2. variables_map(const abstract_variables_map * next);

variables_map public member functions

  1. const variable_value & operator[](const std::string & name) const;

    Obtains the value of variable 'name', from *this and possibly from the chain of variable maps.

    • if there's no value in *this.

      • if there's next variable map, returns value from it

      • otherwise, returns empty value

    • if there's defaulted value

      • if there's next varaible map, which has a non-defauled value, return that

      • otherwise, return value from *this

    • if there's a non-defauled value, returns it.

variables_map private member functions

  1. const variable_value & get(const std::string & name) const;

    Implementation of abstract_variables_map::get which does 'find' in *this.

Copyright 2002-2004 Vladimir Prus