Boost logo

Boost Users :

From: Andrew Schweitzer (a.schweitzer.grps_at_[hidden])
Date: 2008-03-12 20:19:37


Jeremy Conlin wrote:
> This is what I have right now
>
> cout << "options:\n";
> po::variables_map::iterator optIter = options.begin();
> for( ; optIter != options.end(); ++optIter ){
> cout << "\t" << optIter->first << " = " << optIter->second.as
> <http://second.as><string>() << std::endl;
> }
>
I have yet to find a really simple + satisfactory way to do this.

I tried writing a wrapper that stored a string conversion function with
the option when it was declared... but that was bit of a hack and I lost
all the generality.

I concluded it's best to try and print them one by one, not in a loop,
but by name, and do the printing near where the options are added so you
can easily see their names and types.

> ------------------------------------------------------------------------
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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