ID 5786785
Пользователь Смирнов Михаил Александрович
Время 20:08<< 16.11.2021 20:09 (27 д. 18:10) 20:11>>
Обработка 20:09 ... 20:09 (8,85 сек.)
Файл main.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: In member function 'std::vector<GameObject> GameDatabase::DataByName(std::__cxx11::string) const':
game_database.h:35:46: error: invalid use of non-static member function 'bool GameDatabase::compareById(const GameObject&, const GameObject&)'
     std::sort(v.begin(), v.end(), compareById);
                                              ^
game_database.h:66:8: note: declared here
   bool compareById(const GameObject& a, const GameObject& b) {
        ^~~~~~~~~~~
game_database.h: In member function 'std::vector<GameObject> GameDatabase::DataByPosition(size_t, size_t) const':
game_database.h:46:46: error: invalid use of non-static member function 'bool GameDatabase::compareById(const GameObject&, const GameObject&)'
     std::sort(v.begin(), v.end(), compareById);
                                              ^
game_database.h:66:8: note: declared here
   bool compareById(const GameObject& a, const GameObject& b) {
        ^~~~~~~~~~~
game_database.h: In member function 'std::vector<GameObject> GameDatabase::Data() const':
game_database.h:54:46: error: invalid use of non-static member function 'bool GameDatabase::compareById(const GameObject&, const GameObject&)'
     std::sort(v.begin(), v.end(), compareById);
                                              ^
game_database.h:66:8: note: declared here
   bool compareById(const GameObject& a, const GameObject& b) {
        ^~~~~~~~~~~
game_database.h: In static member function 'static int GameDatabase::IsInDb(ObjectId)':
game_database.h:60:34: error: invalid use of member 'GameDatabase::dbase' in static member function
     for (unsigned int i = 0; i < dbase.size(); i++)
                                  ^~~~~
game_database.h:70:27: note: declared here
   std::vector<GameObject> dbase;
                           ^~~~~
game_database.h:61:11: error: invalid use of member 'GameDatabase::dbase' in static member function
       if (dbase[i].id == id)
           ^~~~~
game_database.h:70:27: note: declared here
   std::vector<GameObject> dbase;
                           ^~~~~
[печатать | |
]
(2 109 b)
0.112s 0.009s 10