Hacker News new | ask | show | jobs
by axilmar 1219 days ago
If code depends on a vector having 3 or 4 elements, then yes, a vector with 3 elements is a different type than a vector with 4 elements.

It is actually dependent typing.

Not being able to express types properly is a major issue in c++ and in all other programming languages that do not allow this kind of typing.

The lack of this facility prohibits programmers for declaring their intent properly to the compiler, forcing programmers to keep that information in their head.

To me, it's the no 1 issue that c++ must deal with. It will solve a myriad of problems.