Smart Pointer

Noun · Development

Definitions

  1. A data structure that wraps a raw pointer, providing automatic memory management through reference counting or ownership semantics, such as C++ unique_ptr, shared_ptr, or Rust's Box and Rc.

    In plain English: A wrapper around a memory address that automatically cleans up the memory when nobody needs it anymore, preventing leaks.

    Example: "Use std::unique_ptr instead of raw new/delete and you will never have a double-free again."

Related Terms