title: Boost.Program_options fixed number of tokens
body: <p>Boost.Program_options provides a facility to pass multiple tokens via command line arguments as follows:</p>
  
  <pre><code>std::vector&lt;int&gt; nums;    
  
  po::options_description desc("Allowed options");
  desc.add_options()
      ("help", "Produce help message.")
      ("nums", po::value&lt; std::vector&lt;int&gt; &gt;(&amp;nums)-&gt;multitoken(), "Numbers.")
  ;
  
  po::variables_map vm;
  po::store(po::parse_command_line(argc, argv, desc), vm);
  po::notify(vm);
  </code></pre>
  
  <p>However, what is the preferred way of accepting only a fixed number of arguments? The only solution I could come is to manually assign values:</p>
  
  <pre><code>int nums[2];    
  
  po::options_description desc("Allowed options");
  desc.add_options()
      ("help", "Produce help message.")
      ("nums", "Numbers.")
  ;
  
  po::variables_map vm;
  po::store(po::parse_command_line(argc, argv, desc), vm);
  
  if (vm.count("nums")) {
     // Assign nums
  }
  </code></pre>
  
  <p>This feels a bit clumsy. Is there a better solution?</p>