title: The best way to handle config in large C++ project
body: <p>In order to start my C++ program, I need to read some configs, e.g. ip address, port number, file paths... These settings may change quite frequently (every week or everyday!), so hardcoding them into source files is not a good idea.</p>
  
  <p>After some research, I'm confused about whether there is a best practice to load config settings from a file and made those configs available to other class/module/*.cpp in the same project.</p>
  
  <p>static is <em>bad</em>; singleton is <em>bad</em> (an <em>anti-pattern</em>?) So, what other options do we have? Or, maybe the idea of "config file" is wrong?</p>
  
  <p>EDIT: I have no problem of <em>loading</em> the config file. I'm worried about, after loading all those settings into a std::map&lt; string, string > in memory, how to let other classes, functions access those settings.</p>
  
  <p>EDIT 2: Thanks for everybody's input. I know these patterns that I listed here are <em>FINE</em>, and they are used by lots of programs. I'm curious about whether there is a (sort of) <em>BEST</em> pattern to handle configurations of a program.</p>