c++scalac++11type-safety

Scala strict type system vs C++ type system


For fans of Scala's strict type system, but fans of C++:


Solution

  • Short answer: yes, you can reach the same level of type safety, but it will place a burden on the programmer. It's not simply a question of providing the same safety, the type system must also be powerful and flexible enough to facilitate typesafe programming and in this regard Scalas type system is superior to C++.

    C++0x will add lambda expressions which will facilitate using HOF's like map, filter, flatMap etc.