What is a smart pointer? How do smart pointers manage ownership and lifetimes compared with raw pointers? Describe common types (unique, shared, weak), mechanisms (RAII, reference counting, custom deleters), typical overheads, and pitfalls like reference cycles; include examples from C++ or Rust.