Something baffles me about C++, I can write something like:
struct Test {
double V[3];
}
without a problem, but when I try for e.g.:
struct Test {
vector<double> V(3);
}
the compiler gives me an error. What is the difference between the above, I mean why can't the second one be compiled?
and, this one is even more baffling:
struct Test {
std::vector<double> V[3];
}
The last example that at least in my mind should throw a compiler error is compiled without a problem by both GCC and Clang.
std::array