Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 4 years ago

Language

C++

Compiler

gcc 7.3.0

Options
Warnings
Don't Use Boost
C++17(GNU)
no pedantic
Raw compiler options
-O2

Author

anonymous

over 4 years ago

$ g++ prog.cc -Wall -Wextra -std=gnu++17 -O2
In file included from /opt/wandbox/gcc-7.3.0/include/c++/7.3.0/functional:58:0,
                 from prog.cc:2:
/opt/wandbox/gcc-7.3.0/include/c++/7.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 = main()::<lambda()>; std::false_type = std::integral_constant<bool, false>]':
/opt/wandbox/gcc-7.3.0/include/c++/7.3.0/bits/std_function.h:227: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 = main()::<lambda()>]'
/opt/wandbox/gcc-7.3.0/include/c++/7.3.0/bits/std_function.h:695:19:   required from 'std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = main()::<lambda()>; <template-parameter-2-2> = void; <template-parameter-2-3> = void; _Res = void; _ArgTypes = {}]'
/opt/wandbox/gcc-7.3.0/include/c++/7.3.0/ext/new_allocator.h:136:4:   required from 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::function<void()>; _Args = {main()::<lambda()>}; _Tp = std::function<void()>]'
/opt/wandbox/gcc-7.3.0/include/c++/7.3.0/bits/alloc_traits.h:475:4:   required from 'static void std::allocator_traits<std::allocator<_Tp1> >::construct(std::allocator_traits<std::allocator<_Tp1> >::allocator_type&, _Up*, _Args&& ...) [with _Up = std::function<void()>; _Args = {main()::<lambda()>}; _Tp = std::function<void()>; std::allocator_traits<std::allocator<_Tp1> >::allocator_type = std::allocator<std::function<void()> >]'
/opt/wandbox/gcc-7.3.0/include/c++/7.3.0/bits/deque.tcc:167:30:   required from 'std::deque<_Tp, _Alloc>::reference std::deque<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {main()::<lambda()>}; _Tp = std::function<void()>; _Alloc = std::allocator<std::function<void()> >; std::deque<_Tp, _Alloc>::reference = std::function<void()>&]'
/opt/wandbox/gcc-7.3.0/include/c++/7.3.0/bits/stl_queue.h:263:56:   required from 'decltype(auto) std::queue<_Tp, _Sequence>::emplace(_Args&& ...) [with _Args = {main()::<lambda()>}; _Tp = std::function<void()>; _Sequence = std::deque<std::function<void()>, std::allocator<std::function<void()> > >]'
prog.cc:12:27:   required from here
/opt/wandbox/gcc-7.3.0/include/c++/7.3.0/bits/std_function.h:192:6: error: use of deleted function 'main()::<lambda()>::<lambda>(const main()::<lambda()>&)'
      new _Functor(*__source._M_access<_Functor*>());
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cc:8:33: note: 'main()::<lambda()>::<lambda>(const main()::<lambda()>&)' is implicitly deleted because the default definition would be ill-formed:
     auto l = [p = std::move(ptr)] () mutable {
                                 ^
prog.cc:8:33: error: use of deleted function 'std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = std::__cxx11::basic_string<char>; _Dp = std::default_delete<std::__cxx11::basic_string<char> >]'
In file included from /opt/wandbox/gcc-7.3.0/include/c++/7.3.0/memory:80:0,
                 from prog.cc:1:
/opt/wandbox/gcc-7.3.0/include/c++/7.3.0/bits/unique_ptr.h:388:7: note: declared here
       unique_ptr(const unique_ptr&) = delete;
       ^~~~~~~~~~
Exit Code:
1