Hi all!! I'm using <boost/program_options.hpp> to allow options in my program to be configured using 3 flavors: - Command line values - Config-file values ( parse_config_file). - Default values ( value<double>(&myDouble)->default_value(3.3) ) prioritized in the given order and put all together in the same variables_map. Upon finalization I'd like to generate a config-file (as required by the 2nd flavor) with the actual values used in the run. So far I've come with a solution that involves iterating over the map, and performing the outstreaming by myself. Something in the line of for(variables_map::const_iterator i = vm.begin(); i != vm.end();++i) { std::cout << i->first << " " << i->second.as<std::string>() << std::endl; } What is cumbersome of this approach is that, actually, not all my args are "std::string", so in reality the call to as<>() ends with bad_any_cast in some cases: it seems that there's no operator << defined for i->second or its underlying "boost::any". So I'd have to switch-case over all the types I'm using for the values. Second, I have to format the output in accordance to parse_config_file by myself. Is there any better solution to this? Thanks a lot in advance. -- Rodolfo Federico Gamarra