[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strong Typing, Dynamic Languages, What to do?
Oscar Fuentes wrote:
> This last paragraph confused me. In what sense C++'s type system
> fails? The whole point around C++ type system is that it is verified
> at compile time in a way that there is no need for run-time checks
Define a new type, A.
Define a vector of ten A's.
Make an instance of this vector.
C++'s type system says that all dereferences of this vector will give
you objects of type A.
Dereference the eleventh element of this vector.
Do you get an A?
Shriram