Short answer: yes, you can achieve the same level of type safety, but it will put a strain on the programmer. This is not just a matter of ensuring the same security, the type system must also be powerful enough and flexible enough to facilitate type programming, and in this respect, a Scalas type system is superior to C ++.
C ++ 0x will add lambda expressions that will facilitate the use of HOFs such as map, filter, flatMap, etc.
source share