ID 5732037
Пользователь Травка Евгения Александровна
Время 18:27<< 11.11.2021 18:28 (22 д. 16:28) 18:29>>
Обработка 18:28 ... 18:28 (3,68 сек.)
Файл 5732037.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 2, осень 2021
Задача F: Code format visitor
Набор тестов
Ограничения Время: 1с Память: 4000Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
In file included from main.cpp:121:0:
format_visitor.h:14:22: error: 'GameObject' does not name a type
 bool operator>(const GameObject& a, const GameObject& b) {
                      ^~~~~~~~~~
format_visitor.h:14:43: error: 'GameObject' does not name a type
 bool operator>(const GameObject& a, const GameObject& b) {
                                           ^~~~~~~~~~
format_visitor.h:14:56: error: 'bool operator>(const int&, const int&)' must have an argument of class or enumerated type
 bool operator>(const GameObject& a, const GameObject& b) {
                                                        ^
format_visitor.h:31:15: error: 'ObjectId' has not been declared
   void Insert(ObjectId id, string name, size_t x, size_t y);
               ^~~~~~~~
format_visitor.h:32:15: error: 'ObjectId' has not been declared
   void Remove(ObjectId id);
               ^~~~~~~~
format_visitor.h:33:10: error: 'GameObject' was not declared in this scope
   vector<GameObject> DataByName(string name) const;
          ^~~~~~~~~~
format_visitor.h:33:20: error: template argument 1 is invalid
   vector<GameObject> DataByName(string name) const;
                    ^
format_visitor.h:33:20: error: template argument 2 is invalid
format_visitor.h:34:10: error: 'GameObject' was not declared in this scope
   vector<GameObject> DataByPosition(size_t x, size_t y) const;
          ^~~~~~~~~~
format_visitor.h:34:20: error: template argument 1 is invalid
   vector<GameObject> DataByPosition(size_t x, size_t y) const;
                    ^
format_visitor.h:34:20: error: template argument 2 is invalid
format_visitor.h:35:10: error: 'GameObject' was not declared in this scope
   vector<GameObject> Data() const;
          ^~~~~~~~~~
format_visitor.h:35:20: error: template argument 1 is invalid
   vector<GameObject> Data() const;
                    ^
format_visitor.h:35:20: error: template argument 2 is invalid
format_visitor.h:38:12: error: 'ObjectId' was not declared in this scope
   std::map<ObjectId, GameObject, std::greater<ObjectId>> id_;
            ^~~~~~~~
format_visitor.h:38:22: error: 'GameObject' was not declared in this scope
   std::map<ObjectId, GameObject, std::greater<ObjectId>> id_;
                      ^~~~~~~~~~
format_visitor.h:38:47: error: 'ObjectId' was not declared in this scope
   std::map<ObjectId, GameObject, std::greater<ObjectId>> id_;
                                               ^~~~~~~~
format_visitor.h:38:47: error: template argument 1 is invalid
format_visitor.h:38:55: error: template argument 1 is invalid
   std::map<ObjectId, GameObject, std::greater<ObjectId>> id_;
                                                       ^~
format_visitor.h:38:55: error: template argument 2 is invalid
format_visitor.h:38:55: error: template argument 3 is invalid
format_visitor.h:38:55: error: template argument 4 is invalid
format_visitor.h:39:48: error: 'GameObject' was not declared in this scope
   std::map<std::pair<size_t, size_t>, std::set<GameObject*, /
                                                ^~~~~~~~~~
format_visitor.h:40:46: error: template argument 1 is invalid
   DereferenceCompare<GameObject, std::greater>>> position_;
                                              ^~
format_visitor.h:40:46: error: template argument 2 is invalid
format_visitor.h:40:46: error: template argument 3 is invalid
format_visitor.h:40:48: error: template argument 2 is invalid
   DereferenceCompare<GameObject, std::greater>>> position_;
                                                ^
format_visitor.h:40:48: error: template argument 4 is invalid
format_visitor.h:41:39: error: 'GameObject' was not declared in this scope
   std::unordered_map<string, std::set<GameObject*, /
                                       ^~~~~~~~~~
format_visitor.h:42:46: error: template argument 1 is invalid
   DereferenceCompare<GameObject, std::greater>>> name_;
                                              ^~
format_visitor.h:42:46: error: template argument 2 is invalid
format_visitor.h:42:46: error: template argument 3 is invalid
format_visitor.h:42:48: error: template argument 2 is invalid
   DereferenceCompare<GameObject, std::greater>>> name_;
                                                ^
format_visitor.h:42:48: error: template argument 5 is invalid
format_visitor.h:45:27: error: variable or field 'Insert' declared void
 void GameDatabase::Insert(ObjectId id, string name, size_t x, size_t y) {
                           ^~~~~~~~
format_visitor.h:45:27: error: 'ObjectId' was not declared in this scope
format_visitor.h:45:47: error: expected primary-expression before 'name'
 void GameDatabase::Insert(ObjectId id, string name, size_t x, size_t y) {
                                               ^~~~
format_visitor.h:45:60: error: expected primary-expression before 'x'
 void GameDatabase::Insert(ObjectId id, string name, size_t x, size_t y) {
                                                            ^
format_visitor.h:45:70: error: expected primary-expression before 'y'
 void GameDatabase::Insert(ObjectId id, string name, size_t x, size_t y) {
                                                                      ^
format_visitor.h:54:27: error: variable or field 'Remove' declared void
 void GameDatabase::Remove(ObjectId id) {
                           ^~~~~~~~
format_visitor.h:54:27: error: 'ObjectId' was not declared in this scope
format_visitor.h:63:8: error: 'GameObject' was not declared in this scope
 vector<GameObject> GameDatabase::DataByName(string name) const {
        ^~~~~~~~~~
format_visitor.h:63:18: error: template argument 1 is invalid
 vector<GameObject> GameDatabase::DataByName(string name) const {
                  ^
format_visitor.h:63:18: error: template argument 2 is invalid
format_visitor.h: In member function 'int GameDatabase::DataByName(std::__cxx11::string) const':
format_visitor.h:64:10: error: 'GameObject' was not declared in this scope
   vector<GameObject> result;
          ^~~~~~~~~~
format_visitor.h:64:20: error: template argument 1 is invalid
   vector<GameObject> result;
                    ^
format_visitor.h:64:20: error: template argument 2 is invalid
format_visitor.h:65:25: error: request for member 'find' in '((const GameDatabase*)this)->GameDatabase::name_', which is of non-class type 'const int'
   auto iterator = name_.find(name);
                         ^~~~
format_visitor.h:66:25: error: request for member 'end' in '((const GameDatabase*)this)->GameDatabase::name_', which is of non-class type 'const int'
   if (iterator == name_.end()) return result;
                         ^~~
format_visitor.h:68:12: error: request for member 'push_back' in 'result', which is of non-class type 'int'
     result.push_back(*i);
            ^~~~~~~~~
format_visitor.h: At global scope:
format_visitor.h:73:8: error: 'GameObject' was not declared in this scope
 vector<GameObject> GameDatabase::DataByPosition(size_t x, size_t y) const {
        ^~~~~~~~~~
format_visitor.h:73:18: error: template argument 1 is invalid
 vector<GameObject> GameDatabase::DataByPosition(size_t x, size_t y) const {
                  ^
format_visitor.h:73:18: error: template argument 2 is invalid
format_visitor.h: In member function 'int GameDatabase::DataByPosition(size_t, size_t) const':
format_visitor.h:74:10: error: 'GameObject' was not declared in this scope
   vector<GameObject> result;
          ^~~~~~~~~~
format_visitor.h:74:20: error: template argument 1 is invalid
   vector<GameObject> result;
                    ^
format_visitor.h:74:20: error: template argument 2 is invalid
format_visitor.h:75:29: error: request for member 'find' in '((const GameDatabase*)this)->GameDatabase::position_', which is of non-class type 'const int'
   auto iterator = position_.find({x, y});
                             ^~~~
format_visitor.h:76:29: error: request for member 'end' in '((const GameDatabase*)this)->GameDatabase::position_', which is of non-class type 'const int'
   if (iterator == position_.end()) return result;
                             ^~~
format_visitor.h:78:12: error: request for member 'push_back' in 'result', which is of non-class type 'int'
     result.push_back(*i);
            ^~~~~~~~~
format_visitor.h: At global scope:
format_visitor.h:83:8: error: 'GameObject' was not declared in this scope
 vector<GameObject> GameDatabase::Data() const {
        ^~~~~~~~~~
format_visitor.h:83:18: error: template argument 1 is invalid
 vector<GameObject> GameDatabase::Data() const {
                  ^
format_visitor.h:83:18: error: template argument 2 is invalid
format_visitor.h: In member function 'int GameDatabase::Data() const':
format_visitor.h:84:10: error: 'GameObject' was not declared in this scope
   vector<GameObject> result;
          ^~~~~~~~~~
format_visitor.h:84:20: error: template argument 1 is invalid
   vector<GameObject> result;
                    ^
format_visitor.h:84:20: error: template argument 2 is invalid
format_visitor.h:85:24: error: 'begin' was not declared in this scope
   for (const auto& i : id_) {
                        ^~~
format_visitor.h:85:24: note: suggested alternative:
In file included from /usr/include/c++/7/string:51:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from main.cpp:1:
/usr/include/c++/7/bits/range_access.h:105:37: note:   'std::begin'
   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&);
                                     ^~~~~
In file included from main.cpp:121:0:
format_visitor.h:85:24: error: 'end' was not declared in this scope
   for (const auto& i : id_) {
                        ^~~
format_visitor.h:85:24: note: suggested alternative:
In file included from /usr/include/c++/7/string:51:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from main.cpp:1:
/usr/include/c++/7/bits/range_access.h:107:37: note:   'std::end'
   template<typename _Tp> const _Tp* end(const valarray<_Tp>&);
                                     ^~~
In file included from main.cpp:121:0:
format_visitor.h:86:12: error: request for member 'push_back' in 'result', which is of non-class type 'int'
     result.push_back(i.second);
            ^~~~~~~~~
main.cpp: In function 'int main()':
main.cpp:174:5: error: 'FormatVisitor' was not declared in this scope
     FormatVisitor fv;
     ^~~~~~~~~~~~~
main.cpp:174:5: note: suggested alternative: 'BaseVisitor'
     FormatVisitor fv;
     ^~~~~~~~~~~~~
     BaseVisitor
main.cpp:175:5: error: 'fv' was not declared in this scope
     fv.Visit(my_class.get());
     ^~
main.cpp:175:5: note: suggested alternative: 'fcvt'
     fv.Visit(my_class.get());
     ^~
     fcvt
0.061s 0.009s 9