Last active
May 4, 2017 03:10
-
-
Save veer66/072856a31a3ef5fba47e2343b794c12a to your computer and use it in GitHub Desktop.
This file contains 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 <string> | |
#include <memory> | |
#include <iostream> | |
int | |
main(int argc, char* argv[]) | |
{ | |
std::unique_ptr<std::string> s(new std::string("toto")); | |
std::unique_ptr<std::string> p = std::move(s); | |
std::cout << *(s.get()) << std::endl; | |
return 0; | |
} | |
// g++ -Wall -g -std=c++11 move.cxx | |
// g++ (Ubuntu 5.4.1-2ubuntu1~16.04) 5.4.1 20160904 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment