title: Initializing static class object with no zero argument constructor c++
body: <p>The relevant part of my code is as follows:</p>
  
  <p>In foo.h:</p>
  
  <pre><code>namespace foo_ns {
  class Foo
  {
      static Class1 object1;
  };
  }
  </code></pre>
  
  <p>In foo.cpp</p>
  
  <pre><code>#include &lt;foo.h&gt;
  namespace foo_ns {
  
  Class1 Foo::object1(/*another object. Need to call copy constructor*/)
  
  }
  </code></pre>
  
  <p>Here, "another object" is defined in <code>main()</code>. Furthermore, Class1 is part of a large library and has no zero argument constructors, so simply removing the parenthesis gives a <code>no matching function call</code> error during compilation. From what I understand, static initialization MUST be performed outside of any function.</p>
  
  <p>So ithere any workaround for this? </p>