mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-09 19:45:13 +02:00
8 lines
138 B
C++
8 lines
138 B
C++
#include <memory>
|
|||
|
|||
int use_ptr() {
|
|||
auto ptr = std::make_unique<int>(42);
|
|||
return *ptr;
|
|||
// unique_ptr destroyed at scope exit
|
|||
}
|