title: boost program options - how to conditionally type positional args?
body: <p>I'm using boost program options, and I want to interpret some positional arguments as either strings, or ints, based on a user specified command line switch.  For example:</p>
  
  <pre><code>foo -asint outputfile 10 11 12
  foo -asstr outputfile 10 11 12
  </code></pre>
  
  <p>would list (10,11,12) as ints in the first example and strings in the second.</p>
  
  <p>I can't figure out how to do this using boost po.  Here is a snippet of my command line parsing:</p>
  
  <pre><code>// basic options group
  po::options_description genericOpts("allowed options");
  genericOpts.add_options()
      ("help,h", "display help message / usage")
      ("asint,i", "interpret arguments ints instead of strings")
  ;
  
  // hidden options group - don't show in help
  po::options_description hiddenOpts("hidden options");
  hiddenOpts.add_options()
      ("filename", po::value&lt;string&gt;()-&gt;required(),"output file")
      ("inputs", po::value&lt;vector&lt;string&gt;&gt;(), "inputs, either strings or ints")
  ;
  
  po::options_description cmdline_options;
  cmdline_options.add(genericOpts).add(hiddenOpts);
  
  po::positional_options_description p;
  p.add("filename",1).add("inputs", -1);
  
  po::variables_map vm;
  po::store(po::command_line_parser(argc, argv).
            options(cmdline_options).positional(p).run(), vm);
  </code></pre>