How does subscripting multiple times work for std::array
even though all operator[]
returns is a reference, without using any proxy-objects (as shown here)?
Example:
#include <iostream>
#include <array>
using namespace std;
int main()
{
array<array<int, 3>, 4> structure;
structure[2][2] = 2;
cout << structure[2][2] << endl;
return 0;
}
How/why does this work?