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.

Function bool_switch

boost::program_options::bool_switch —


BOOST_PROGRAM_OPTIONS_DECL typed_value< bool > * bool_switch();
BOOST_PROGRAM_OPTIONS_DECL typed_value< bool > * bool_switch(bool * v);


Works the same way as the 'value<bool>' function, but the created value_semantic won't accept any explicit value. So, if the option is present on the command line, the value will be 'true'.

Copyright 2002-2004 Vladimir Prus