How can I build this typ of class interface
<p>I am interested in trying something where I create a custom type and then access to its members using dot semantics. For example:</p>

<pre><code> Class A{ //simplified, omitting constructors and other methods
   private:
   float numbers[3];
   public:
   float x(){ return numbers[0]; }
   float y(){ return numbers[1]; }
   float z(){ return numbers[2]; }
  }
</code></pre>

<p>So I can do something like this:</p>

<pre><code>  A a;
  //do stuff to populate `numbers`

  float x=a.x;
</code></pre>

<p>But I would also like to make the elements in <code>numbers</code> lvalues so I can do something like this:</p>

<pre><code>  A a;
  a.y=5; //assigns 5 to numbers[1]
</code></pre>

<p>How can I do this setting method?</p>
