No, it doesn't.
std::vector<std::unique_ptr<int>> x;
x.push_back(std::make_unique(1));
auto& y = *x[0];
x.clear();
std::cout << y; // use after free
This is, of course, a toy example. For lots and lots of real examples, search Web browser engine bug trackers for UAF vulnerabilities. (They have been using smart pointers exclusively for a decade or so now.)> A good STL impl will have iterator debugging, which catches iterator invalidation.
Valgrind and ASan catch UAF too and have been around for years and years. Yet we still have a ton of UAF vulnerabilities.