title: Is there a technique for named instances of an anonymous struct to reference functions inside the enclosing class?
body: <p>I have a CRTP class where for API clarity during refactoring, I want to have a named anonymous struct containing methods, instead of having all methods at class scope.  The problem is, these methods need access to the outer scope.  For example:</p>
  <pre><code>template&lt;typename T&gt;
  class sample_class {
  public:
     struct  {
        void do_something() {
            auto&amp; result = get_ref().something_else(); //get_ref() out of inner struct scope
            ...
        }
     } inner;
  
  private:
    T&amp; get_ref() { return static_cast&lt;T&amp;&gt;(*this); }
  };
  </code></pre>
  <p>Is there some technique to make this work?  Specifically C++14 and gcc7, since I do not believe anonymous structs are technically standard compliant.</p>