C++ -- Why not return Array1D&?
<pre><code>template&lt;class T&gt;
class Array2D {
public:
  class Array1D {
  public:
    T&amp; operator[](int index);
    const T&amp; operator[](int index) const;
    ...
  };

  Array1D operator[](int index); // why not return Array1D&amp;
  const Array1D operator[](int index) const; // why not return Array1D&amp;
  ...
};
</code></pre>

<p>The above code is used to simulate a two-dimensional array with a class named as Array2D.
Here is the question, why we should return Array1D rather than Array1D&amp;?</p>

<p>Thank you</p>
