ID 5779064
Пользователь Борцов Роман Александрович
Время 16:39<< 15.11.2021 16:39 (26 д. 14:40) 16:41>>
Обработка 16:39 ... 16:39 (3,39 сек.)
Файл 5779064.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 2, осень 2021
Задача E: GameDatabase
Набор тестов
Ограничения Время: 1с Память: 4000Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
In file included from main.cpp:18:0:
game_database.h:14:27: error: 'DereferenceCompare' was not declared in this scope
     std::set<GameObject*, DereferenceCompare<GameObject,
                           ^~~~~~~~~~~~~~~~~~
game_database.h:15:10: error: template argument 2 is invalid
     std::greater>>> fastPos;
          ^~~~~~~
game_database.h:15:10: error: type/value mismatch at argument 3 in template parameter list for 'template<class _Key, class _Compare, class _Alloc> class std::set'
game_database.h:15:10: note:   expected a type, got 'greater'
game_database.h:15:17: error: template argument 2 is invalid
     std::greater>>> fastPos;
                 ^~
game_database.h:15:17: error: template argument 4 is invalid
game_database.h:15:19: error: expected unqualified-id before '>' token
     std::greater>>> fastPos;
                   ^
game_database.h:17:5: error: 'DereferenceCompare' was not declared in this scope
     DereferenceCompare<GameObject, std::greater>>> fastName;
     ^~~~~~~~~~~~~~~~~~
game_database.h:17:41: error: template argument 2 is invalid
     DereferenceCompare<GameObject, std::greater>>> fastName;
                                         ^~~~~~~
game_database.h:17:41: error: type/value mismatch at argument 3 in template parameter list for 'template<class _Key, class _Compare, class _Alloc> class std::set'
game_database.h:17:41: note:   expected a type, got 'greater'
game_database.h:17:48: error: template argument 2 is invalid
     DereferenceCompare<GameObject, std::greater>>> fastName;
                                                ^~
game_database.h:17:48: error: template argument 5 is invalid
game_database.h:17:50: error: expected unqualified-id before '>' token
     DereferenceCompare<GameObject, std::greater>>> fastName;
                                                  ^
game_database.h: In member function 'void GameDatabase::Insert(ObjectId, std::__cxx11::string, size_t, size_t)':
game_database.h:28:9: error: 'fastPos' was not declared in this scope
         fastPos[{x, y}].insert(obj);
         ^~~~~~~
game_database.h:28:9: note: suggested alternative: 'fastId'
         fastPos[{x, y}].insert(obj);
         ^~~~~~~
         fastId
game_database.h:29:9: error: 'fastName' was not declared in this scope
         fastName[name].insert(obj);
         ^~~~~~~~
game_database.h:29:9: note: suggested alternative: 'fastId'
         fastName[name].insert(obj);
         ^~~~~~~~
         fastId
game_database.h: In member function 'void GameDatabase::Remove(ObjectId)':
game_database.h:34:26: error: 'fastPos' was not declared in this scope
             auto posIt = fastPos[{idIt->second.x, idIt->second.y}];
                          ^~~~~~~
game_database.h:34:26: note: suggested alternative: 'fastId'
             auto posIt = fastPos[{idIt->second.x, idIt->second.y}];
                          ^~~~~~~
                          fastId
game_database.h:41:27: error: 'fastName' was not declared in this scope
             auto nameIt = fastName[idIt->second.name];
                           ^~~~~~~~
game_database.h:41:27: note: suggested alternative: 'fastId'
             auto nameIt = fastName[idIt->second.name];
                           ^~~~~~~~
                           fastId
game_database.h: In member function 'std::vector<GameObject> GameDatabase::DataByName(std::__cxx11::string) const':
game_database.h:53:18: error: 'fastName' was not declared in this scope
         auto s = fastName.at(name);
                  ^~~~~~~~
game_database.h:53:18: note: suggested alternative: 'fastId'
         auto s = fastName.at(name);
                  ^~~~~~~~
                  fastId
game_database.h:54:54: error: no matching function for call to 'std::vector<GameObject>::vector(<brace-enclosed initializer list>)'
         return vector<GameObject> {s.begin(), s.end()};
                                                      ^
In file included from /usr/include/c++/7/vector:64:0,
                 from main.cpp:3:
/usr/include/c++/7/bits/stl_vector.h:411:2: note: candidate: template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&)
  vector(_InputIterator __first, _InputIterator __last,
  ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:411:2: note:   template argument deduction/substitution failed:
/usr/include/c++/7/bits/stl_vector.h:383:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<GameObject>]
       vector(initializer_list<value_type> __l,
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:383:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/7/bits/stl_vector.h:358:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<GameObject>]
       vector(vector&& __rv, const allocator_type& __m)
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:358:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/7/bits/stl_vector.h:348:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, const allocator_type&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<GameObject>]
       vector(const vector& __x, const allocator_type& __a)
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:348:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/7/bits/stl_vector.h:344:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>]
       vector(vector&& __x) noexcept
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:344:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/7/bits/stl_vector.h:326:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>]
       vector(const vector& __x)
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:326:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/7/bits/stl_vector.h:295:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const value_type&, const allocator_type&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = GameObject; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<GameObject>]
       vector(size_type __n, const value_type& __value,
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:295:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/7/bits/stl_vector.h:283:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<GameObject>]
       vector(size_type __n, const allocator_type& __a = allocator_type())
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:283:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/7/bits/stl_vector.h:270:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<GameObject>]
       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:270:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/7/bits/stl_vector.h:259:7: note: candidate: std::vector<_Tp, _Alloc>::vector() [with _Tp = GameObject; _Alloc = std::allocator<GameObject>]
       vector()
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:259:7: note:   candidate expects 0 arguments, 2 provided
In file included from main.cpp:18:0:
game_database.h: In member function 'std::vector<GameObject> GameDatabase::DataByPosition(size_t, size_t) const':
game_database.h:57:18: error: 'fastPos' was not declared in this scope
         auto s = fastPos.at({x, y});
                  ^~~~~~~
game_database.h:57:18: note: suggested alternative: 'fastId'
         auto s = fastPos.at({x, y});
                  ^~~~~~~
                  fastId
game_database.h:58:54: error: no matching function for call to 'std::vector<GameObject>::vector(<brace-enclosed initializer list>)'
         return vector<GameObject> {s.begin(), s.end()};
                                                      ^
In file included from /usr/include/c++/7/vector:64:0,
                 from main.cpp:3:
/usr/include/c++/7/bits/stl_vector.h:411:2: note: candidate: template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&)
  vector(_InputIterator __first, _InputIterator __last,
  ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:411:2: note:   template argument deduction/substitution failed:
/usr/include/c++/7/bits/stl_vector.h:383:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<GameObject>]
       vector(initializer_list<value_type> __l,
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:383:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/7/bits/stl_vector.h:358:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<GameObject>]
       vector(vector&& __rv, const allocator_type& __m)
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:358:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/7/bits/stl_vector.h:348:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, const allocator_type&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<GameObject>]
       vector(const vector& __x, const allocator_type& __a)
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:348:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/7/bits/stl_vector.h:344:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>]
       vector(vector&& __x) noexcept
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:344:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/7/bits/stl_vector.h:326:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>]
       vector(const vector& __x)
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:326:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/7/bits/stl_vector.h:295:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const value_type&, const allocator_type&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = GameObject; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<GameObject>]
       vector(size_type __n, const value_type& __value,
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:295:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/7/bits/stl_vector.h:283:7: note: candidate: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<GameObject>]
       vector(size_type __n, const allocator_type& __a = allocator_type())
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:283:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/7/bits/stl_vector.h:270:7: note: candidate: std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = GameObject; _Alloc = std::allocator<GameObject>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<GameObject>]
       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:270:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/7/bits/stl_vector.h:259:7: note: candidate: std::vector<_Tp, _Alloc>::vector() [with _Tp = GameObject; _Alloc = std::allocator<GameObject>]
       vector()
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:259:7: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/7/vector:62:0,
                 from main.cpp:3:
/usr/include/c++/7/bits/stl_construct.h: In instantiation of 'void std::_Construct(_T1*, _Args&& ...) [with _T1 = GameObject; _Args = {const std::pair<const long long unsigned int, GameObject>&}]':
/usr/include/c++/7/bits/stl_uninitialized.h:83:18:   required from 'static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::_Rb_tree_const_iterator<std::pair<const long long unsigned int, GameObject> >; _ForwardIterator = GameObject*; bool _TrivialValueTypes = false]'
/usr/include/c++/7/bits/stl_uninitialized.h:134:15:   required from '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::_Rb_tree_const_iterator<std::pair<const long long unsigned int, GameObject> >; _ForwardIterator = GameObject*]'
/usr/include/c++/7/bits/stl_uninitialized.h:289:37:   required from '_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::_Rb_tree_const_iterator<std::pair<const long long unsigned int, GameObject> >; _ForwardIterator = GameObject*; _Tp = GameObject]'
/usr/include/c++/7/bits/stl_vector.h:1331:33:   required from 'void std::vector<_Tp, _Alloc>::_M_range_initialize(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = std::_Rb_tree_const_iterator<std::pair<const long long unsigned int, GameObject> >; _Tp = GameObject; _Alloc = std::allocator<GameObject>]'
/usr/include/c++/7/bits/stl_vector.h:1299:23:   required from 'void std::vector<_Tp, _Alloc>::_M_initialize_dispatch(_InputIterator, _InputIterator, std::__false_type) [with _InputIterator = std::_Rb_tree_const_iterator<std::pair<const long long unsigned int, GameObject> >; _Tp = GameObject; _Alloc = std::allocator<GameObject>]'
/usr/include/c++/7/bits/stl_vector.h:414:26:   required from 'std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = std::_Rb_tree_const_iterator<std::pair<const long long unsigned int, GameObject> >; <template-parameter-2-2> = void; _Tp = GameObject; _Alloc = std::allocator<GameObject>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<GameObject>]'
game_database.h:61:63:   required from here
/usr/include/c++/7/bits/stl_construct.h:75:7: error: no matching function for call to 'GameObject::GameObject(const std::pair<const long long unsigned int, GameObject>&)'
     { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); }
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:10:8: note: candidate: GameObject::GameObject()
 struct GameObject
        ^~~~~~~~~~
main.cpp:10:8: note:   candidate expects 0 arguments, 1 provided
main.cpp:10:8: note: candidate: GameObject::GameObject(const GameObject&)
main.cpp:10:8: note:   no known conversion for argument 1 from 'const std::pair<const long long unsigned int, GameObject>' to 'const GameObject&'
main.cpp:10:8: note: candidate: GameObject::GameObject(GameObject&&)
main.cpp:10:8: note:   no known conversion for argument 1 from 'const std::pair<const long long unsigned int, GameObject>' to 'GameObject&&'
[печатать | |
]
(2 071 b)
0.104s 0.008s 10