It's saying something more and the response is in your quotation:
[...] not even its size, which is a template parameter, fixed on compile time [...]
As an example, the following code is legal as well:
template<int N>
struct C {
int size() { return N; }
};
As you can see, here we do the same and N is not kept anyway, but it is known for it's a template parameter, fixed on compile time.
The same is valid for the templated class std::array
, that accepts a template parameter that defines its size. Because of that, the size is known (and fixed) at compile time and it is implicitly part of the generated type, even though no extra space is reserved at runtime.
EDIT (accordingly with the comments)
Of course, you cannot change at runtime the size of such an array by simply invoking one of its methods. As stated here:
std::array is a container that encapsulates fixed size arrays.
Also, it wouldn't make sense to dynamically change its size, for it would be no longer coherent with the template parameter that defines the actual size. Because of that, the response is obviously: no, you cannot change its size (even though you can use that array to fill another array having a different size, of course).
However, you have a bunch of benefits for that:
The struct combines the performance and accessibility of a C-style array with the benefits of a standard container, such as knowing its own size, supporting assignment, random access iterators, etc.
It's up to you to decide if it's worth to use it instead of a plain, C-style array. It mainly depends on the problem you are facing with, so I cannot say that.