Is Vector
C standards have undergone revisions over time, notably from C 03 to C 11, leading to stricter requirements for each container operation. This allows for the inclusion of types that are copy-constructible but not assignable, such as structures with const members, in vectors as long as specific operations are performed (e.g., construction and push_back).
The inquiry arises as to whether this relaxation in standards allows for the creation of vector
The inability to do much with a vector of constant objects, as well as the near equivalence of a const vector
The C standards over the years have continuously refined this aspect, from explicitly barring any type in C 03 to excluding even const and volatile object types in C 17.
The above is the detailed content of Can You Create a `std::vector` in C 11?. For more information, please follow other related articles on the PHP Chinese website!