title: Boost Program Options bool always True
body: <p>With program options, I am checking valid combinations of arguments. But for some reason, gpu argument is a bool and it is always true regardless if I set it to false on the command line. Is there a way that gpu option can be false if I specified it on the command line? I want to be able to make a bool variable that represents if the option on the command line was used. </p>
  
  <p>Also I couldn't find any documentation on count() for variables_map. Is it a std::map function?</p>
  
  <p>Partial Code:</p>
  
  <pre><code>namespace po = boost::program_options;
  po::options_description desc("Allowed Options");
  desc.add_options()
    ("help,h", "Produce help message")
    ("remove_database,r",po::value&lt;std::vector&lt;std::string&gt;&gt;
      (&amp;remove_database),
      "Remove a pre-built database, provide a name(s) of the database")
    ("gpu,u", po::bool_switch()-&gt;default_value(false),
      "Use GPU? Only for specific algorithms");
  
  po::variables_map vm;
  po::store(po::parse_command_line(argc,argv,desc),vm);
  po::notify(vm);
  
  //Processing Cmd Args
  bool help           = vm.count("help");
  bool remove         = vm.count("remove_database");
  bool gpu            = vm.count("gpu");
  
  test(help,"help");
  test(remove, "remove");
  test(gpu, "gpu");
  
  .....
  void test(bool var1, std::string var2){
    if(var1)
      std::cout &lt;&lt; var2 &lt;&lt; " is active " &lt;&lt; std::endl;
   else
      std::cout &lt;&lt; var2 &lt;&lt; " is not active " &lt;&lt; std::endl;
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>$./a.out -r xx -u off
  remove is active 
  gpu is active
  $./a.out -r xx -u false
  remove is active 
  gpu is active
  </code></pre>