title: Parsing a configuration file with boost::program_options
body: <p>Good day,</p>
  
  <p>i wrote a class to parse a configuration file via boost::program_options. Here is what I have (shortened):</p>
  
  <pre><code>namespace nsProOp = boost::program_options;
  nsProOp::variables_map m_variableMap;
  nsProOp::options_description m_description;
  
  
  
  // To add options to the variableMap, e.g. "addOption&lt;int&gt;("money_amount");"
  template &lt;class T&gt;
      void addOption(const std::string&amp; option, const std::string&amp; helpDescription = "") {
          m_description.add_options()(option.c_str(), nsProOp::value&lt;T &gt; (), helpDescription.c_str());
      }
  
  
  
  // And this is how i actually read the file:
  void ConfigFile::parse() {
      std::ifstream file;
      file.open(m_pathToFile.c_str());
  
      nsProOp::store(nsProOp::parse_config_file(file, m_description, true), m_variableMap);
      nsProOp::notify(m_variableMap);      
  }
  </code></pre>
  
  <p>Okay, this works fine. But i want to be able to parse the same file again so that I always use the latest entries provided by the user! The boost documentation says about "store":</p>
  
  <blockquote>
    <p>"Stores in 'm' all options that are defined in 'options'. 
            If 'm' already has a non-defaulted value of an option, that value
            is not changed, even if 'options' specify some value."   </p>
  </blockquote>
  
  <p>So, if I call "parse()" again nothing happens, because m_variableMap is filled. My attempt to call m_variableMap.clear() does not solve my problem, so store only works the first time.</p>
  
  <p>Has anybody an advice for me? If my question is unclear, just tell me. Thanks!</p>