ID 5787042
Пользователь Мастерских Софья Александровна
Время 19:06<< 16.11.2021 20:40 (27 д. 18:41) 20:42>>
Обработка 20:40 ... 20:40 (5,77 сек.)
Файл 5787042.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 2, осень 2021
Задача B: Фабрика
Набор тестов
Ограничения Время: 1с Память: 4096Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
In file included from main.cpp:17:0:
factory.h:12:46: error: ISO C++ forbids declaration of 'ObjIns' with no type [-fpermissive]
   explicit ObjIns(const std::string& class_id):
                                              ^
factory.h:12:3: error: only declarations of constructors and conversion operators can be 'explicit'
   explicit ObjIns(const std::string& class_id):
   ^~~~~~~~
factory.h: In member function 'int SubFactory::ObjIns(const string&)':
factory.h:13:5: error: only constructors take member initializers
     callPhrase(class_id) {}
     ^~~~~~~~~~
factory.h:13:27: error: no return statement in function returning non-void [-Werror=return-type]
     callPhrase(class_id) {}
                           ^
factory.h: In member function 'Object* Factory::Create(const string&)':
factory.h:29:35: error: no matching function for call to 'SubFactory::SubFactory(const string&)'
     return new SubFactory(class_id);
                                   ^
factory.h:10:7: note: candidate: SubFactory::SubFactory()
 class SubFactory : public Object {
       ^~~~~~~~~~
factory.h:10:7: note:   candidate expects 0 arguments, 1 provided
factory.h:10:7: note: candidate: SubFactory::SubFactory(const SubFactory&)
factory.h:10:7: note:   no known conversion for argument 1 from 'const string {aka const std::__cxx11::basic_string<char>}' to 'const SubFactory&'
factory.h:10:7: note: candidate: SubFactory::SubFactory(SubFactory&&)
factory.h:10:7: note:   no known conversion for argument 1 from 'const string {aka const std::__cxx11::basic_string<char>}' to 'SubFactory&&'
cc1plus: all warnings being treated as errors
[печатать | |
]
(581 b)
0.085s 0.009s 10