Created
August 25, 2012 18:07
-
-
Save engie/3468672 to your computer and use it in GitHub Desktop.
Compiler output compiling unique_ptr_fail1.cpp
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
$ g++ -std=c++11 -g -fPIC ptr.cpp -o ptr | |
ptr.cpp: In constructor ‘A::A(std::unique_ptr<int>)’: | |
ptr.cpp:6:44: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = int; _Dp = std::default_delete<int>]’ | |
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/../../../../include/c++/4.7.0/memory:86:0, | |
from ptr.cpp:1: | |
/usr/lib/gcc/x86_64-redhat-linux/4.7.0/../../../../include/c++/4.7.0/bits/unique_ptr.h:256:7: error: declared here | |
ptr.cpp: In function ‘int main(int, char**)’: | |
ptr.cpp:14:12: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = int; _Dp = std::default_delete<int>]’ | |
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/../../../../include/c++/4.7.0/memory:86:0, | |
from ptr.cpp:1: | |
/usr/lib/gcc/x86_64-redhat-linux/4.7.0/../../../../include/c++/4.7.0/bits/unique_ptr.h:256:7: error: declared here | |
ptr.cpp:6:5: error: initializing argument 1 of ‘A::A(std::unique_ptr<int>)’ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment