jweinst1
8/18/2017 - 10:16 PM

demonstrates shared pnt being made

demonstrates shared pnt being made

#include <iostream>
#include <memory>
 
void foo(const std::shared_ptr<int>& i)
{
    (*i)++;
}
 
int main()
{
    auto sp = std::make_shared<int>(12);
    foo(sp);
    std::cout << *sp << '\n';
}