Why is a C++ Vector called a Vector? [closed]

It’s called a vector because Alex Stepanov, the designer of the Standard Template Library, was looking for a name to distinguish it from built-in arrays. He admits now that he made a mistake, because mathematics already uses the term ‘vector’ for a fixed-length sequence of numbers. C++11 compounds this mistake by introducing a class ‘array’ that behaves similarly to a mathematical vector.

Alex’s lesson: be very careful every time you name something.

Leave a Comment