title: Direct access to nested classes and structures in C++
body: <p>In my code the following pattern is recurrent:</p>
  
  <pre><code>class Assembler {/*...*/}; //does something, in this case assembles a matrix
  class AssemblerParam {/*...*/}; //contains the parameters needed to create 
                                  //an object of the Assembler class
  class AssemblerReader {/*...*/}; //reads a file and creates an 
                                   //object of AssemblerParam
  </code></pre>
  
  <p>I have realized this can be organized a lot better by nesting AssemblerParam and AssemblerReader inside Assembler (plus some advantages for generic programming)</p>
  
  <pre><code>class Assembler {
  public:
      class Param { /*...*/ };
      class Reader{ /*...*/ };
  private:
      Param parameters;
  };
  </code></pre>
  
  <p>However, now the implementation of the methods of Assembler is a lot less readable for things like this</p>
  
  <pre><code>void Assembler::method() {
      parameters.mesh.method(parameters.member.method());
      //the code now is cluttered with the word "parameters"
  }
  </code></pre>
  
  <p>Instead I would like my code to read:</p>
  
  <pre><code>void Assembler::method() {
      mesh.method(member.method()); //a lot more readable
  }
  </code></pre>
  
  <p>Any solution?</p>
  
  <p><strong>Remark 1</strong> 
  Using inheritance like this</p>
  
  <pre><code>class AssemblerParam{/*...*/};
  class Assembler : public AssemblerParam { /*...*/ };
  </code></pre>
  
  <p>would help on readability, but would pollute my namespace with classes SomethingParam. </p>