Without seeing the context it gets a little complicated to answer, including because it is common the person who is explaining what he read has misinterpreted.
I believe you’re just talking about a guy array with fixed size, as is the array of C. It would be an opposition to a array which can be expanded if necessary. You can see more on Difference between Std::list, Std::vector and Std:array.
The question became quite confused and what it seemed to ask was not quite what it showed after the comment give a context. The information is still there because it may be useful to someone but what was asked was something else. In the text that was used to generate doubt does not have the term Fixed type (fixed type) as shown in the question, it speaks of fixed size type, which is quite different, including the fact that it has array in the question here has nothing to do with doubt, it was just about array in the question there in the Code Review SE. We were misled.
The question is about the types that have the guaranteed bit quantity. Original in C the primary data types were specified only with minimum size and each implementation of the C language compiler could choose the actual size according to the architecture it would generate the code, which could give better efficiency. Over time it was found that in many cases it would be interesting to have types where you know the exact size to be used. C and C++ adopted this, but the pattern still remained the exact size type not specified in advance. So these guys that came later in the language are called fixed-size types.
It is not recommended to use typedef
in modern C++ , it is better to use using
that the compiler is better prepared, typedef
still works because of legacy. in this context it is a type nickname.
Normally type aliases are used for the sake of readability (show intention) and to give some flexibility, so you use an abstract type and depending on the include
that using concrete can be different. This example being the same is a coincidence. In programming coincidences do not count, so do not count on them, this context is different from others, is looking at the photo and not the film.
It is no longer recommended to use ALL_CASE notation for anything in C++.
In relation to
std::array
he is merely a wrapper over a classic C com array that allows you to easily move to functions and continue to use C++ idiomatic things like foreach without losing information about the size of the array. It ends up being easy enough, without any significant disadvantage.– Isac