Why can I call the private constructor from ?global scope?
<p>this code compiles and runs without errors:</p>

<pre><code>class foo{
  static foo *ref;
  foo(){}
  public:
    static foo *getRef(){
      return ref;
    }
    void bar(){}
};

foo* foo::ref = new foo; // the construcrtor is private!

int main(int argc, const char *argv[])
{
  foo* f = foo::getRef();
  f-&gt;bar();
  return 0;
}
</code></pre>

<p>could somebody explain why can the constructor be called?</p>
