Removing auto_ptr
The lesson introduces how the pointers have been revamped for the better.
C++98 added auto_ptr
as a way to support basic RAII features for raw pointers. However, due to the lack of move semantics in the language, this smart pointer could be easily misused and cause
runtime errors.
Here’s an example where auto_ptr
might cause a crash:
Get hands-on with 1200+ tech skills courses.