On 24/04/2008, John Femiani
On Wed, Apr 23, 2008 at 05:06:58AM +0000, Ryan Gallagher wrote:
Jeffery Cavallaro
writes: [...] For example, if I wanted to a program to spit out all of its options to standard out, there doesn't seem to be any hooks to extract an Any value in a generic way (e.g., as a string).
Okay, this isn't exactly generic and only addresses this specific case for the issue that you brought up, but for program_options where you normally just have a limited number of types I've used:
I've done something similar as well. If you have a lot of types, and you want support for vectors of those types, you may want to look at the boost preprocessor macro library:
So, could somebody write a visit_any function / macro, or do we need to do some kind of hack each time. I am imagining a visit_any function that takes an mpl vector of types as an argument ...
This has been discussed many times in the dev list I think, search for 'any visitor' in the archives. I posted a small utility some time ago as a base for discussion. It was named badly (any_variant), since I needed a visitor mechanism identical to the one in boost::variant , maybe it could be of some use to someone =) http://lists.boost.org/Archives/boost/2007/09/127126.php / Christian
-- John Femiani
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users