Language
C++
Compiler
gcc HEAD 13.0.1 20230219 (experimental)
Options
Warnings
Don't Use Boost
C++2b
no pedantic
$ g++ prog.cc -Wall -Wextra -std=c++2b
Exit Code:
1
Author
anonymous
about 2 years ago
C++
gcc HEAD 13.0.1 20230219 (experimental)
Author
anonymous
about 2 years ago
$ g++ prog.cc -Wall -Wextra -std=c++2b
prog.cc: In instantiation of 'auto func(const auto:16&) [with auto:16 = std::unique_ptr<int>]':
prog.cc:11:31: required from 'void f(T&&) [with T = std::unique_ptr<int>]'
prog.cc:21:4: required from here
prog.cc:6:10: 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>]'
6 | return v;
| ^
In file included from /opt/wandbox/gcc-head/include/c++/13.0.1/memory:78,
from prog.cc:3:
/opt/wandbox/gcc-head/include/c++/13.0.1/bits/unique_ptr.h:523:7: note: declared here
523 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~