Author
anonymous
almost 5 years ago
Language
Compiler
Options
Author
anonymous
almost 5 years ago
$
In file included from /opt/wandbox/gcc-9.3.0/include/c++/9.3.0/functional:59,
from prog.cc:1:
/opt/wandbox/gcc-9.3.0/include/c++/9.3.0/bits/std_function.h: In instantiation of 'static void std::_Function_base::_Base_manager<_Functor>::_M_clone(std::_Any_data&, const std::_Any_data&, std::false_type) [with _Functor = Func; std::false_type = std::integral_constant<bool, false>]':
/opt/wandbox/gcc-9.3.0/include/c++/9.3.0/bits/std_function.h:211:16: required from 'static bool std::_Function_base::_Base_manager<_Functor>::_M_manager(std::_Any_data&, const std::_Any_data&, std::_Manager_operation) [with _Functor = Func]'
/opt/wandbox/gcc-9.3.0/include/c++/9.3.0/bits/std_function.h:677:19: required from 'std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = Func; <template-parameter-2-2> = void; <template-parameter-2-3> = void; _Res = void; _ArgTypes = {}]'
prog.cc:13:35: required from here
/opt/wandbox/gcc-9.3.0/include/c++/9.3.0/bits/std_function.h:176:6: error: use of deleted function 'Func::Func(const Func&)'
176 | new _Functor(*__source._M_access<const _Functor*>());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cc:4:8: note: 'Func::Func(const Func&)' is implicitly deleted because the default definition would be ill-formed:
4 | struct Func {
| ^~~~
prog.cc:4:8: 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 /opt/wandbox/gcc-9.3.0/include/c++/9.3.0/memory:80,
from prog.cc:2:
/opt/wandbox/gcc-9.3.0/include/c++/9.3.0/bits/unique_ptr.h:414:7: note: declared here
414 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
Exit Code:
1