title: Weird issue using static map in c++
body: <p>I have an issue that I don't understand why it happens. In a nutshell, I would like to create a singleton to read a configuration file where each property will be stored in a map.</p>
  
  <p>I defined my configuration class (.h) as</p>
  
  <pre><code>class Configuration {
  public:
      static Configuration* getInstance(std::string configFile);
  
  private:
      static std::map&lt;std::string, std::string&gt; properties;
      static bool instanceFlag;
      static Configuration *instance;
  
      Configuration();
      Configuration(std::string configFile);
      ~Configuration();
  };
  </code></pre>
  
  <p>On the implementation class I have the following:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  
  #include "Configuration.h"
  
  std::map&lt;std::string, std::string&gt; Configuration::properties {};
  bool Configuration::instanceFlag = false;
  Configuration *Configuration::instance = NULL;
  </code></pre>
  
  <p>The issue is, my variable properties is the type of Configuration instead of a map. If a replace the key and value to be a int, the properties becomes a map. It seems weird.</p>
  
  <p>I included string on my header file.</p>
  
  <p>There is not exception or error. I mean, the compilation runs fine not error. However, my map is always empty. Debugging it on eclipse I noticed that the type of the variable properties is Configuration instead of map.</p>
  
  <p>When I change the key and value type from string to int, the type of the object properties is map.</p>
  
  <p>Have you seen it before? What am I missing here?</p>
  
  <p>Thanks
  Mauro</p>