#include <iostream>
#include <memory>

std::unique_ptr<int> getData() {
    std::unique_ptr<int> a = std::make_unique<int>(5);
    return a;
}
int main() {
    std::unique_ptr<int> b = getData();
    // std::unique_ptr<int> c = b; 
    std::cout << *b << std::endl;
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: