|
Boost Users : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-04-24 05:51:52
Fran?ois Duranleau wrote:
>> I wrote a wrapper class that adds options to a list as they are added to
>> program_options, then you can print the list. This is a hack.
>
> Also, another 'hack' is that, looking in the code, you can notice that
> variables_map inherits from std::map as well (though it's not documented
> as such). You can thus use standard STL iterators, e.g.
>
> for ( variables_map::iterator i = vm.begin() ; i != vm.end() ; ++ i )
> {
> //...
> }
>
> The type of values iterated over are pairs of std::string and
> boost::program_options::variable_value.
I have no idea why BoostBook decided to hide that inheritance, but it was
designed that way, so that you can iterate variables_map. I've added
comment to that effect to varaibles_map class docs.
- Volodya
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net