ID 5786680
Пользователь Дранов Семен Владимирович
Время 20:00<< 16.11.2021 20:00 (27 д. 18:01) 20:01>>
Обработка 20:00 ... 20:00 (8,73 сек.)
Файл 5786680.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:49:5: error: 'explisit' does not name a type; did you mean 'va_list'?
     explisit Smth(const std::string &class_id) {
     ^~~~~~~~
     va_list
factory.h: In function 'Object* my_new_smth_()':
factory.h:62:27: error: no matching function for call to 'Smth::Smth(const char [5])'
     return new Smth("plug");
                           ^
factory.h:47:7: note: candidate: Smth::Smth()
 class Smth : public Object {
       ^~~~
factory.h:47:7: note:   candidate expects 0 arguments, 1 provided
factory.h:47:7: note: candidate: Smth::Smth(const Smth&)
factory.h:47:7: note:   no known conversion for argument 1 from 'const char [5]' to 'const Smth&'
factory.h:47:7: note: candidate: Smth::Smth(Smth&&)
factory.h:47:7: note:   no known conversion for argument 1 from 'const char [5]' to 'Smth&&'
factory.h: In static member function 'static Object* Factory::Create(const string&)':
factory.h:76:41: error: no matching function for call to 'Smth::Smth(const string&)'
                 return new Smth(class_id);
                                         ^
factory.h:47:7: note: candidate: Smth::Smth()
 class Smth : public Object {
       ^~~~
factory.h:47:7: note:   candidate expects 0 arguments, 1 provided
factory.h:47:7: note: candidate: Smth::Smth(const Smth&)
factory.h:47:7: note:   no known conversion for argument 1 from 'const string {aka const std::__cxx11::basic_string<char>}' to 'const Smth&'
factory.h:47:7: note: candidate: Smth::Smth(Smth&&)
factory.h:47:7: note:   no known conversion for argument 1 from 'const string {aka const std::__cxx11::basic_string<char>}' to 'Smth&&'
main.cpp: At global scope:
main.cpp:27:7: error: redefinition of 'class Smth'
 class Smth : public Object {
       ^~~~
In file included from main.cpp:17:0:
factory.h:47:7: note: previous definition of 'class Smth'
 class Smth : public Object {
       ^~~~
main.cpp: In function 'Object* my_new_smth_()':
main.cpp:40:9: error: redefinition of 'Object* my_new_smth_()'
 Object* my_new_smth_() {
         ^~~~~~~~~~~~
In file included from main.cpp:17:0:
factory.h:61:9: note: 'Object* my_new_smth_()' previously defined here
 Object *my_new_smth_() {
         ^~~~~~~~~~~~
main.cpp:41:29: error: no matching function for call to 'Smth::Smth(std::__cxx11::string&)'
     return new Smth(class_id);
                             ^
In file included from main.cpp:17:0:
factory.h:47:7: note: candidate: Smth::Smth()
 class Smth : public Object {
       ^~~~
factory.h:47:7: note:   candidate expects 0 arguments, 1 provided
factory.h:47:7: note: candidate: Smth::Smth(const Smth&)
factory.h:47:7: note:   no known conversion for argument 1 from 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' to 'const Smth&'
factory.h:47:7: note: candidate: Smth::Smth(Smth&&)
factory.h:47:7: note:   no known conversion for argument 1 from 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' to 'Smth&&'
0.054s 0.009s 9