Author
anonymous
about 7 years ago
Language
C++
Compiler
gcc 8.1.0
Options
Warnings
Boost 1.67.0
C++14
no pedantic
Author
anonymous
about 7 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.67.0/gcc-8.1.0/include -std=c++14
prog.cc: In function 'int main()':
prog.cc:11:32: error: use of deleted function 'std::mutex::mutex(const std::mutex&)'
auto t1 = mkT1<std::mutex>();
^
In file included from /opt/wandbox/gcc-8.1.0/include/c++/8.1.0/mutex:43,
from prog.cc:1:
/opt/wandbox/gcc-8.1.0/include/c++/8.1.0/bits/std_mutex.h:97:5: note: declared here
mutex(const mutex&) = delete;
^~~~~
prog.cc:12:32: error: use of deleted function 'std::mutex::mutex(const std::mutex&)'
auto t2 = mkT2<std::mutex>();
^
In file included from /opt/wandbox/gcc-8.1.0/include/c++/8.1.0/mutex:43,
from prog.cc:1:
/opt/wandbox/gcc-8.1.0/include/c++/8.1.0/bits/std_mutex.h:97:5: note: declared here
mutex(const mutex&) = delete;
^~~~~
prog.cc: In instantiation of 'T mkT2() [with T = std::mutex]':
prog.cc:12:32: required from here
prog.cc:7:22: error: use of deleted function 'std::mutex::mutex(const std::mutex&)'
T mkT2() { return T {}; }
^
In file included from /opt/wandbox/gcc-8.1.0/include/c++/8.1.0/mutex:43,
from prog.cc:1:
/opt/wandbox/gcc-8.1.0/include/c++/8.1.0/bits/std_mutex.h:97:5: note: declared here
mutex(const mutex&) = delete;
^~~~~
Exit Code:
1