Borderou de evaluare (job #2386687)

Utilizator bolovMihail Balan bolov Data 23 martie 2019 14:18:11
Problema Stramosi Status done
Runda Arhiva de probleme Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp: In member function 'auto Problem::solve_impl()': main.cpp:72:63: error: invalid initialization of reference of type 'Ancestor&' from expression of type 'std::reference_wrapper<Ancestor>' for (Ancestor& ancestor : ancestors_by_level[level]) ^ In file included from /usr/include/c++/6/vector:69:0, from main.cpp:12: /usr/include/c++/6/bits/vector.tcc: In instantiation of 'void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {Ancestor&}; _Tp = std::reference_wrapper<Ancestor>; _Alloc = std::allocator<std::reference_wrapper<Ancestor> >]': main.cpp:61:73: required from here /usr/include/c++/6/bits/vector.tcc:98:6: error: cannot increment a pointer to incomplete type 'std::reference_wrapper<Ancestor>' ++this->_M_impl._M_finish; ^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0, from /usr/include/c++/6/algorithm:61, from main.cpp:7: /usr/include/c++/6/bits/stl_iterator.h: In instantiation of '__gnu_cxx::__normal_iterator<_Iterator, _Container>& __gnu_cxx::__normal_iterator<_Iterator, _Container>::operator++() [with _Iterator = std::reference_wrapper<Ancestor>*; _Container = std::vector<std::reference_wrapper<Ancestor> >]': main.cpp:72:63: required from here /usr/include/c++/6/bits/stl_iterator.h:799:2: error: cannot increment a pointer to incomplete type 'std::reference_wrapper<Ancestor>' ++_M_current; ^~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/c++allocator.h:33:0, from /usr/include/c++/6/bits/allocator.h:46, from /usr/include/c++/6/string:41, from /usr/include/c++/6/bits/locale_classes.h:40, from /usr/include/c++/6/bits/ios_base.h:41, from /usr/include/c++/6/ios:42, from /usr/include/c++/6/istream:38, from /usr/include/c++/6/fstream:38, from main.cpp:9: /usr/include/c++/6/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::reference_wrapper<Ancestor>; _Args = {Ancestor&}; _Tp = std::reference_wrapper<Ancestor>]': /usr/include/c++/6/bits/alloc_traits.h:475:4: required from 'static void std::allocator_traits<std::allocator<_Tp> >::construct(std::allocator_traits<std::allocator<_Tp> >::allocator_type&, _Up*, _Args&& ...) [with _Up = std::reference_wrapper<Ancestor>; _Args = {Ancestor&}; _Tp = std::reference_wrapper<Ancestor>; std::allocator_traits<std::allocator<_Tp> >::allocator_type = std::allocator<std::reference_wrapper<Ancestor> >]' /usr/include/c++/6/bits/vector.tcc:96:30: required from 'void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {Ancestor&}; _Tp = std::reference_wrapper<Ancestor>; _Alloc = std::allocator<std::reference_wrapper<Ancestor> >]' main.cpp:61:73: required from here /usr/include/c++/6/ext/new_allocator.h:120:4: error: invalid use of incomplete type 'class std::reference_wrapper<Ancestor>' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/6/bits/move.h:57:0, from /usr/include/c++/6/bits/stl_pair.h:59, from /usr/include/c++/6/utility:70, from /usr/include/c++/6/algorithm:60, from main.cpp:7: /usr/include/c++/6/type_traits:2139:11: note: declaration of 'class std::reference_wrapper<Ancestor>' class reference_wrapper; ^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/6/vector:64:0, from main.cpp:12: /usr/include/c++/6/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = std::reference_wrapper<Ancestor>; _Alloc = std::allocator<std::reference_wrapper<Ancestor> >]': /usr/include/c++/6/bits/stl_vector.h:427:33: required from 'std::vector<_Tp, _Alloc>::~vector() [with _Tp = std::reference_wrapper<Ancestor>; _Alloc = std::allocator<std::reference_wrapper<Ancestor> >]' /usr/include/c++/6/bits/stl_pair.h:194:12: required from 'std::pair<_T1, _T2>::pair(std::piecewise_construct_t, std::tuple<_Args1 ...>, std::tuple<_Args2 ...>) [with _Args1 = {const int&}; _Args2 = {}; _T1 = const int; _T2 = std::vector<std::reference_wrapper<Ancestor> >]' /usr/include/c++/6/ext/new_allocator.h:120:4: required from 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::pair<const int, std::vector<std::reference_wrapper<Ancestor> > >; _Args = {const std::piecewise_construct_t&, std::tuple<const int&>, std::tuple<>}; _Tp = std::pair<const int, std::vector<std::reference_wrapper<Ancestor> > >]' /usr/include/c++/6/bits/alloc_traits.h:475:4: required from 'static void std::allocator_traits<std::allocator<_Tp> >::construct(std::allocator_traits<std::allocator<_Tp> >::allocator_type&, _Up*, _Args&& ...) [with _Up = std::pair<const int, std::vector<std::reference_wrapper<Ancestor> > >; _Args = {const std::piecewise_construct_t&, std::tuple<const int&>, std::tuple<>}; _Tp = std::pair<const int, std::vector<std::reference_wrapper<Ancestor> > >; std::allocator_traits<std::allocator<_Tp> >::allocator_type = std::allocator<std::pair<const int, std::vector<std::reference_wrapper<Ancestor> > > >]' Non zero exit status: 1

Ceva nu functioneaza?