Skip to content

Instantly share code, notes, and snippets.

@engie
Created August 25, 2012 18:07
Show Gist options
  • Save engie/3468665 to your computer and use it in GitHub Desktop.
Save engie/3468665 to your computer and use it in GitHub Desktop.
Trying to copy a unique_ptr
#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