Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class variable_value

boost::program_options::variable_value

Synopsis

// In header: <boost/program_options/variables_map.hpp>


class variable_value {
public:
  // construct/copy/destruct
  ();
  (, );

  // friend functions
   
  (basic_parsed_options< , variables_map &, );

  // public member functions
  template<typename T>  () ;
  template<typename T>  ();
   () ;
   () ;
   () ;
   ();
};

Description

Class holding value of option. Contains details about how the value is set and allows to conveniently obtain the value.

variable_value public construct/copy/destruct

  1. ();
  2. ( xv,  xdefaulted);

variable_value friend functions

  1.  
    (basic_parsed_options<  options, variables_map & m, );

    Stores in 'm' all options that are defined in 'options'. If 'm' already has a non-defaulted value of an option, that value is not changed, even if 'options' specify some value.

variable_value public member functions

  1. template<typename T>  () ;

    If stored value if of type T, returns that value. Otherwise, throws boost::bad_any_cast exception.

  2. template<typename T>  ();

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

  3.  () ;
    Returns true if no value is stored.
  4.  () ;

    Returns true if the value was not explicitly given, but has default value.

  5.  () ;

    Returns the contained value.

  6.  ();

    Returns the contained value.


PrevUpHomeNext