#include <print> #include <memory> int main() { // unique_ptr owns a heap int and frees it when it goes out of scope auto boxed = std::make_unique<int>(42); *boxed += 1; std::println("{}", *boxed); }
one owner, freed automatically