title: Default member initializer needed within definition of enclosing class outside of member functions
body: <p>very simple example having nested structures and a method with defaulted value</p>
  
  <pre><code>struct outer {
      struct inner
      {
          int x{0};
      };
  
      void foo(inner = inner())
      {}
  };
  </code></pre>
  
  <p>compiling with clang and gcc8 both return this error</p>
  
  <pre><code>main.cpp:7:22: error: default member initializer for 'x' needed within definition of enclosing class 'outer' outside of member functions
  
      void foo(inner = inner())
  
                       ^
  
  main.cpp:4:13: note: default member initializer declared here
  
          int x{0};
  
              ^
  
  1 error generated.
  </code></pre>
  
  <p>example: <a href="http://coliru.stacked-crooked.com/a/f28eb47735bfa4e5" rel="nofollow noreferrer">http://coliru.stacked-crooked.com/a/f28eb47735bfa4e5</a></p>
  
  <p>I've read <a href="https://stackoverflow.com/questions/43819314/default-member-initializer-needed-within-definition-of-enclosing-class-outside">this</a> and <a href="https://stackoverflow.com/questions/46866686/default-member-initializer-needed-within-definition-of-enclosing-class-outside">this</a> but still have no idea what's going on?</p>