Created
August 25, 2012 18:07
-
-
Save engie/3468665 to your computer and use it in GitHub Desktop.
Trying to copy a unique_ptr
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> | |
class A | |
{ | |
public: | |
A( std::unique_ptr< int > v ) : m_v( v ) {} | |
std::unique_ptr< int > m_v; | |
}; | |
int main( int argc, char** argv ) | |
{ | |
std::unique_ptr< int > i( new int(10) ); | |
A a( i ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment