I've been using Eigen recently and while everything makes sense, and I am just a little confused about how the library gets away with the weird syntax that it uses.
For example, when defining an matrix, you are supposed to do:
MatrixXd m(2,2); //defines a 3 x 4 matrix
m(0, 0) = 1;
m(0, 1) = 2;
m(1, 0) = 3;
m(1, 1) = 4;
or you can do something like:
Matrix3f m;
m << 1, 2, 3,
4, 5, 6,
7, 8, 9;
std::cout << m;
While these commands make sense conceptually to me, I am curious about how they make sense to the compiler. I thought << was used for bit-shifting and that the bracket notation was used for inputting parameter functions or something, not for parsing through a matrix structure like an array.
I haven't been working with C++ for long enough to understand all of this syntax, but I was wondering if the writers of Eigen somehow defined custom syntax or something.