Created
May 2, 2015 07:55
-
-
Save H2CO3/90247fb6ed3fa5a9726c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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