title: static constexpr member of same type as class being defined
body: <p>I would like a class C to have a static constexpr member of type C. Is this possible in C++11?</p>
  
  <p>Attempt 1:</p>
  
  <pre><code>struct Foo {
      constexpr Foo() {}
      static constexpr Foo f = Foo();
  };
  constexpr Foo Foo::f;
  </code></pre>
  
  <p>g++ 4.7.0 says: 'invalid use of incomplete type' referring to the <code>Foo()</code> call.</p>
  
  <p>Attempt 2:</p>
  
  <pre><code>struct Foo {
      constexpr Foo() {}
      static constexpr Foo f;
  };
  constexpr Foo Foo::f = Foo();
  </code></pre>
  
  <p>Now the problem is the lack of an initializer for the <code>constexpr</code> member <code>f</code> inside the class definition.</p>
  
  <p>Attempt 3:</p>
  
  <pre><code>struct Foo {
      constexpr Foo() {}
      static const Foo f;
  };
  constexpr Foo Foo::f = Foo();
  </code></pre>
  
  <p>Now g++ complains about a redeclaration of <code>Foo::f</code> differing in <code>constexpr</code>.</p>