Efficient / elegant two dimensional container
<p>Need for two dimensional array of objects that could be something like:</p>

<pre><code>myContainer&lt;myObject*&gt; *a = new myArray&lt;myObject*&gt;( 20, 20 ); // passing int's as width &amp; height 
</code></pre>

<p>later accessing values would be done with methods such as:</p>

<pre><code>mylist&lt;myObject*&gt; getRow( int );
mylist&lt;myObject*&gt; getColumn( int );
mylist&lt;myObject*&gt; getDiagonalRow( int );
</code></pre>

<p>implementations of those could be something like:</p>

<pre><code>myList&lt;myObject*&gt; myContainer::getRow( int a ){
    if( a &lt; 0 &amp;&amp; a&gt;=this-&gt;height ) 
        return; 
    myList&lt;myObject*&gt; hlp;
    for( int i=0; i&lt;this-&gt;width; i++)
        hlp.append( this-&gt;arr[a][i] );
    return hlp; // returns a copy. Could also be a pointer if created with new.
}
</code></pre>

<p>Other methods could follow similar lines, ie. creating a list object and filling it with what was requested. </p>

<p>My questions: Can anyone think of elegant way to create a container class I'm describing here. Which could for example avoid creating and filling of list-objects but still maintaining the abstraction and/or usability. Or please advice if I have missed something in STL etc. that has something like this.</p>
