4 ms·
Even smart pointers can trivially cause memory unsafety. The simplest example is that std::move-ing a uniq_ptr makes the original nullptr, which is just sitting
by steveklabnik 10y ago
Even smart pointers can trivially cause memory unsafety. The simplest example is that std::move-ing a uniq_ptr makes the original nullptr, which is just sitting around, waiting to be dereferenced. This compiles cleanly with all warnings enabled on every compiler I've tried it on, yet that dereference is UB.