|
|
|
|
|
by pjmlp
1835 days ago
|
|
Yes, because while it isn't fullproof due to copy-paste compatibility with C89, at least it offers better tooling for safer coding, provided one doesn't code "C with C++ compiler". Namely: - proper string and vector types (most compilers allow to enable bounds checking anyway) - stronger rules for type conversions - reference types for parameters - better tooling for immutable data structures - memory allocation primitives instead of getting sizeof wrong to malloc() - collection library instead of reinventing the wheel in each project - RAII - smart pointers - templates instead of error prone macros - namespacing (usefull in large scale projects with prefix tricks) |
|
string & vector types: STL, 1998 type conversion operators: 1998. mutable keyword: 1998. collection library: STL, 1998. smart pointers: STL, auto_ptr<> in C++98
I'd argue that without STL & C++98, C++ would've languished even longer. And with STL, it still took another 5 years for the compilers to be good enough.