title: Define a static variable in header only using macro
body: <p>My goal is to be able to create a static variables solely in header with a macro that would take care of initializing it in a <code>.cpp</code> file for me with value I've provided. It should look something like this:</p>
  
  <pre><code>struct UserDefaults {
      STATIC(bool, isFullscreen, true)
      STATIC(bool, isBorderless, false)
      STATIC(std::string, profileName, "") 
  }
  </code></pre>
  
  <p>Which would be equal to:</p>
  
  <pre><code>// .hpp file
  struct UserDefaults {
      static bool isFullscreen;
      static bool isBorderless;
      static std::string profileName;
  }
  
  // .cpp file
  bool UserDefaults::isFullscreen = true;
  bool UserDefaults::isBorderless= false;
  std::string UserDefaults::profileName = "";
  </code></pre>
  
  <p>I've looked at <a href="https://stackoverflow.com/questions/11709859">How to have static data members in a header-only library?</a>, but I wasn't able to apply Pesche's solution for my case.</p>