Skip to content

Instantly share code, notes, and snippets.

@H2CO3
Created May 2, 2015 07:55
Show Gist options
  • Save H2CO3/90247fb6ed3fa5a9726c to your computer and use it in GitHub Desktop.
Save H2CO3/90247fb6ed3fa5a9726c to your computer and use it in GitHub Desktop.
#include <memory>
#include <cstdio>
static void foo(std::unique_ptr<int> p)
{
printf("%d\n", *p);
}
int main()
{
auto p = std::unique_ptr<int>(new int { 1337 });
foo(p);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment