fork(1) download
  1. #include<map>
  2. #include<thread>
  3. #include<vector>
  4. using namespace std;
  5.  
  6. int main ()
  7. {
  8. map<void*, vector<thread>> m1, m2;
  9. m1.insert(m2.begin(), m2.end()); // error
  10. }
  11.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
In file included from /usr/include/c++/4.8/memory:64:0,
                 from /usr/include/c++/4.8/thread:40,
                 from prog.cpp:2:
/usr/include/c++/4.8/bits/stl_construct.h: In instantiation of ‘void std::_Construct(_T1*, _Args&& ...) [with _T1 = std::thread; _Args = {const std::thread&}]’:
/usr/include/c++/4.8/bits/stl_uninitialized.h:75:53:   required from ‘static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::thread*, std::vector<std::thread> >; _ForwardIterator = std::thread*; bool _TrivialValueTypes = false]’
/usr/include/c++/4.8/bits/stl_uninitialized.h:117:41:   required from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::thread*, std::vector<std::thread> >; _ForwardIterator = std::thread*]’
/usr/include/c++/4.8/bits/stl_uninitialized.h:258:63:   required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::thread*, std::vector<std::thread> >; _ForwardIterator = std::thread*; _Tp = std::thread]’
/usr/include/c++/4.8/bits/stl_vector.h:316:32:   required from ‘std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::thread; _Alloc = std::allocator<std::thread>]’
/usr/include/c++/4.8/bits/stl_pair.h:127:17:   required from ‘std::_Rb_tree_node<_Val>::_Rb_tree_node(_Args&& ...) [with _Args = {std::pair<void* const, std::vector<std::thread, std::allocator<std::thread> > >&}; _Val = std::pair<void* const, std::vector<std::thread> >]’
/usr/include/c++/4.8/ext/new_allocator.h:120:4:   [ skipping 3 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/usr/include/c++/4.8/bits/stl_tree.h:408:36:   required from ‘std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_create_node(_Args&& ...) [with _Args = {std::pair<void* const, std::vector<std::thread, std::allocator<std::thread> > >&}; _Key = void*; _Val = std::pair<void* const, std::vector<std::thread> >; _KeyOfValue = std::_Select1st<std::pair<void* const, std::vector<std::thread> > >; _Compare = std::less<void*>; _Alloc = std::allocator<std::pair<void* const, std::vector<std::thread> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<void* const, std::vector<std::thread> > >*]’
/usr/include/c++/4.8/bits/stl_tree.h:1023:66:   required from ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr, std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr, _Arg&&) [with _Arg = std::pair<void* const, std::vector<std::thread> >&; _Key = void*; _Val = std::pair<void* const, std::vector<std::thread> >; _KeyOfValue = std::_Select1st<std::pair<void* const, std::vector<std::thread> > >; _Compare = std::less<void*>; _Alloc = std::allocator<std::pair<void* const, std::vector<std::thread> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator = std::_Rb_tree_iterator<std::pair<void* const, std::vector<std::thread> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr = std::_Rb_tree_node_base*]’
/usr/include/c++/4.8/bits/stl_tree.h:1482:33:   required from ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique_(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator, _Arg&&) [with _Arg = std::pair<void* const, std::vector<std::thread> >&; _Key = void*; _Val = std::pair<void* const, std::vector<std::thread> >; _KeyOfValue = std::_Select1st<std::pair<void* const, std::vector<std::thread> > >; _Compare = std::less<void*>; _Alloc = std::allocator<std::pair<void* const, std::vector<std::thread> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator = std::_Rb_tree_iterator<std::pair<void* const, std::vector<std::thread> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator = std::_Rb_tree_const_iterator<std::pair<void* const, std::vector<std::thread> > >]’
/usr/include/c++/4.8/bits/stl_tree.h:1722:37:   required from ‘void std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_II, _II) [with _InputIterator = std::_Rb_tree_iterator<std::pair<void* const, std::vector<std::thread> > >; _Key = void*; _Val = std::pair<void* const, std::vector<std::thread> >; _KeyOfValue = std::_Select1st<std::pair<void* const, std::vector<std::thread> > >; _Compare = std::less<void*>; _Alloc = std::allocator<std::pair<void* const, std::vector<std::thread> > >]’
/usr/include/c++/4.8/bits/stl_map.h:671:11:   required from ‘void std::map<_Key, _Tp, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _InputIterator = std::_Rb_tree_iterator<std::pair<void* const, std::vector<std::thread> > >; _Key = void*; _Tp = std::vector<std::thread>; _Compare = std::less<void*>; _Alloc = std::allocator<std::pair<void* const, std::vector<std::thread> > >]’
prog.cpp:9:37:   required from here
/usr/include/c++/4.8/bits/stl_construct.h:75:7: error: use of deleted function ‘std::thread::thread(const std::thread&)’
     { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); }
       ^
In file included from prog.cpp:2:0:
/usr/include/c++/4.8/thread:126:5: error: declared here
     thread(const thread&) = delete;
     ^
stdout
Standard output is empty