ID 5786668
Пользователь Морозов Денис Витальевич
Время 19:59<< 16.11.2021 19:59 (27 д. 18:00) 20:02>>
Обработка 19:59 ... 19:59 (2,89 сек.)
Файл 5786668.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 2, осень 2021
Задача A: Набор фигур
Набор тестов
Ограничения Время: 1с Память: 4096Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
In file included from main.cpp:17:0:
figure.h:22:17: error: 'std::__cxx11::string Triangle::Name()' marked 'override', but does not override
     std::string Name() override {return "Triangle";}
                 ^~~~
figure.h:23:12: error: 'double Triangle::Perimetet()' marked 'override', but does not override
     double Perimetet() override {return (a + b + c);}
            ^~~~~~~~~
figure.h:24:12: error: 'double Triangle::Area()' marked 'override', but does not override
     double Area() override {
            ^~~~
figure.h:40:17: error: 'std::__cxx11::string Rect::Name()' marked 'override', but does not override
     std::string Name() override {return "Rect";}
                 ^~~~
figure.h:41:12: error: 'double Rect::Perimetet()' marked 'override', but does not override
     double Perimetet() override {return (2 * (width + height));}
            ^~~~~~~~~
figure.h:42:12: error: 'double Rect::Area()' marked 'override', but does not override
     double Area() override {return (width * height);}
            ^~~~
figure.h:52:17: error: 'std::__cxx11::string Circle::Name()' marked 'override', but does not override
     std::string Name() override {return "Circle";}
                 ^~~~
figure.h:53:12: error: 'double Circle::Perimetet()' marked 'override', but does not override
     double Perimetet() override {return (6.28 * r);}
            ^~~~~~~~~
figure.h:54:12: error: 'double Circle::Area()' marked 'override', but does not override
     double Area() override {return (3.14 + pow(r, 2));}
            ^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33:0,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/string:41,
                 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/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Rect; _Args = {double&, double&}; _Tp = Rect]':
/usr/include/c++/7/bits/alloc_traits.h:475:4:   required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = Rect; _Args = {double&, double&}; _Tp = Rect; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<Rect>]'
/usr/include/c++/7/bits/shared_ptr_base.h:526:39:   required from 'std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {double&, double&}; _Tp = Rect; _Alloc = std::allocator<Rect>; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr_base.h:637:4:   required from 'std::__shared_count<_Lp>::__shared_count(std::_Sp_make_shared_tag, _Tp*, const _Alloc&, _Args&& ...) [with _Tp = Rect; _Alloc = std::allocator<Rect>; _Args = {double&, double&}; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr_base.h:1295:35:   required from 'std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Rect>; _Args = {double&, double&}; _Tp = Rect; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
/usr/include/c++/7/bits/shared_ptr.h:344:64:   required from 'std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<Rect>; _Args = {double&, double&}; _Tp = Rect]'
/usr/include/c++/7/bits/shared_ptr.h:690:14:   required from 'std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = Rect; _Alloc = std::allocator<Rect>; _Args = {double&, double&}]'
/usr/include/c++/7/bits/shared_ptr.h:706:39:   required from 'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = Rect; _Args = {double&, double&}]'
figure.h:65:52:   required from here
/usr/include/c++/7/ext/new_allocator.h:136:4: error: invalid new-expression of abstract class type 'Rect'
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:17:0:
figure.h:31:7: note:   because the following virtual functions are pure within 'Rect':
 class Rect : public Figure {
       ^~~~
figure.h:8:25: note: 	virtual std::__cxx11::string Figure::Name() const
     virtual std::string Name() const = 0;
                         ^~~~
figure.h:9:20: note: 	virtual double Figure::Perimeter() const
     virtual double Perimeter() const = 0;
                    ^~~~~~~~~
figure.h:10:20: note: 	virtual double Figure::Area() const
     virtual double Area() const = 0;
                    ^~~~
0.033s 0.011s 9