ID 5786329
Пользователь Морозов Денис Витальевич
Время 19:27<< 16.11.2021 19:28 (27 д. 17:28) 19:32>>
Обработка 19:28 ... 19:28 (1,97 сек.)
Файл 5786329.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: In function 'auto CreateFigure(std::istringstream&)':
figure.h:70:50: error: inconsistent deduction for auto return type: 'std::shared_ptr<Rect>' and then 'std::shared_ptr<Triangle>'
         return std::make_shared<Triangle>(a, b, c);
                                                  ^
figure.h:70:50: error: no matching function for call to 'std::shared_ptr<Rect>::shared_ptr(std::shared_ptr<Triangle>)'
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:352:7: note: candidate: std::shared_ptr<_Tp>::shared_ptr(const std::weak_ptr<_Tp>&, std::nothrow_t) [with _Tp = Rect]
       shared_ptr(const weak_ptr<_Tp>& __r, std::nothrow_t)
       ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:352:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/7/bits/shared_ptr.h:342:2: note: candidate: template<class _Alloc, class ... _Args> std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...)
  shared_ptr(_Sp_make_shared_tag __tag, const _Alloc& __a,
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:342:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:70:50: note:   candidate expects at least 2 arguments, 1 provided
         return std::make_shared<Triangle>(a, b, c);
                                                  ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:294:17: note: candidate: constexpr std::shared_ptr<_Tp>::shared_ptr(std::nullptr_t) [with _Tp = Rect; std::nullptr_t = std::nullptr_t]
       constexpr shared_ptr(nullptr_t) noexcept : shared_ptr() { }
                 ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:294:17: note:   no known conversion for argument 1 from 'std::shared_ptr<Triangle>' to 'std::nullptr_t'
/usr/include/c++/7/bits/shared_ptr.h:286:2: note: candidate: template<class _Yp, class _Del, std::shared_ptr<Rect>::_Constructible<std::unique_ptr<_Tp, _Dp>, std::__sp_array_delete>* <anonymous> > std::shared_ptr<_Tp>::shared_ptr(std::unique_ptr<_Up, _Ep>&&)
  shared_ptr(unique_ptr<_Yp, _Del>&& __r)
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:286:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:70:50: note:   'std::shared_ptr<Triangle>' is not derived from 'std::unique_ptr<_Tp, _Dp>'
         return std::make_shared<Triangle>(a, b, c);
                                                  ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:277:2: note: candidate: template<class _Yp, class _Del, class> std::shared_ptr<_Tp>::shared_ptr(std::unique_ptr<_Up, _Ep>&&)
  shared_ptr(unique_ptr<_Yp, _Del>&& __r)
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:277:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:70:50: note:   'std::shared_ptr<Triangle>' is not derived from 'std::unique_ptr<_Tp, _Dp>'
         return std::make_shared<Triangle>(a, b, c);
                                                  ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:270:2: note: candidate: template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(std::auto_ptr<_Up>&&)
  shared_ptr(auto_ptr<_Yp>&& __r);
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:270:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:70:50: note:   'std::shared_ptr<Triangle>' is not derived from 'std::auto_ptr<_Up>'
         return std::make_shared<Triangle>(a, b, c);
                                                  ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:265:11: note: candidate: template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(const std::weak_ptr<_Yp>&)
  explicit shared_ptr(const weak_ptr<_Yp>& __r)
           ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:265:11: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:70:50: note:   'std::shared_ptr<Triangle>' is not derived from 'const std::weak_ptr<_Tp>'
         return std::make_shared<Triangle>(a, b, c);
                                                  ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:253:2: note: candidate: template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(std::shared_ptr<_Yp>&&)
  shared_ptr(shared_ptr<_Yp>&& __r) noexcept
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:253:2: note:   template argument deduction/substitution failed:
/usr/include/c++/7/bits/shared_ptr.h:244:7: note: candidate: std::shared_ptr<_Tp>::shared_ptr(std::shared_ptr<_Tp>&&) [with _Tp = Rect]
       shared_ptr(shared_ptr&& __r) noexcept
       ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:244:7: note:   no known conversion for argument 1 from 'std::shared_ptr<Triangle>' to 'std::shared_ptr<Rect>&&'
/usr/include/c++/7/bits/shared_ptr.h:236:2: note: candidate: template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(const std::shared_ptr<_Yp>&)
  shared_ptr(const shared_ptr<_Yp>& __r) noexcept
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:236:2: note:   template argument deduction/substitution failed:
/usr/include/c++/7/bits/shared_ptr.h:224:2: note: candidate: template<class _Yp> std::shared_ptr<_Tp>::shared_ptr(const std::shared_ptr<_Yp>&, std::shared_ptr<_Tp>::element_type*)
  shared_ptr(const shared_ptr<_Yp>& __r, element_type* __p) noexcept
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:224:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:70:50: note:   candidate expects 2 arguments, 1 provided
         return std::make_shared<Triangle>(a, b, c);
                                                  ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:202:2: note: candidate: template<class _Deleter, class _Alloc> std::shared_ptr<_Tp>::shared_ptr(std::nullptr_t, _Deleter, _Alloc)
  shared_ptr(nullptr_t __p, _Deleter __d, _Alloc __a)
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:202:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:70:50: note:   candidate expects 3 arguments, 1 provided
         return std::make_shared<Triangle>(a, b, c);
                                                  ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:183:2: note: candidate: template<class _Yp, class _Deleter, class _Alloc, class> std::shared_ptr<_Tp>::shared_ptr(_Yp*, _Deleter, _Alloc)
  shared_ptr(_Yp* __p, _Deleter __d, _Alloc __a)
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:183:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:70:50: note:   mismatched types '_Yp*' and 'std::shared_ptr<Triangle>'
         return std::make_shared<Triangle>(a, b, c);
                                                  ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:163:2: note: candidate: template<class _Deleter> std::shared_ptr<_Tp>::shared_ptr(std::nullptr_t, _Deleter)
  shared_ptr(nullptr_t __p, _Deleter __d)
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:163:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:70:50: note:   candidate expects 2 arguments, 1 provided
         return std::make_shared<Triangle>(a, b, c);
                                                  ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:146:2: note: candidate: template<class _Yp, class _Deleter, class> std::shared_ptr<_Tp>::shared_ptr(_Yp*, _Deleter)
  shared_ptr(_Yp* __p, _Deleter __d)
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:146:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:70:50: note:   mismatched types '_Yp*' and 'std::shared_ptr<Triangle>'
         return std::make_shared<Triangle>(a, b, c);
                                                  ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:129:2: note: candidate: template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(_Yp*)
  shared_ptr(_Yp* __p) : __shared_ptr<_Tp>(__p) { }
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:129:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:70:50: note:   mismatched types '_Yp*' and 'std::shared_ptr<Triangle>'
         return std::make_shared<Triangle>(a, b, c);
                                                  ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:119:7: note: candidate: std::shared_ptr<_Tp>::shared_ptr(const std::shared_ptr<_Tp>&) [with _Tp = Rect]
       shared_ptr(const shared_ptr&) noexcept = default;
       ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:119:7: note:   no known conversion for argument 1 from 'std::shared_ptr<Triangle>' to 'const std::shared_ptr<Rect>&'
/usr/include/c++/7/bits/shared_ptr.h:117:17: note: candidate: constexpr std::shared_ptr<_Tp>::shared_ptr() [with _Tp = Rect]
       constexpr shared_ptr() noexcept : __shared_ptr<_Tp>() { }
                 ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:117:17: note:   candidate expects 0 arguments, 1 provided
In file included from main.cpp:17:0:
figure.h:75:38: error: inconsistent deduction for auto return type: 'std::shared_ptr<Rect>' and then 'std::shared_ptr<Circle>'
     return std::make_shared<Circle>(r);
                                      ^
figure.h:75:38: error: no matching function for call to 'std::shared_ptr<Rect>::shared_ptr(std::shared_ptr<Circle>)'
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:352:7: note: candidate: std::shared_ptr<_Tp>::shared_ptr(const std::weak_ptr<_Tp>&, std::nothrow_t) [with _Tp = Rect]
       shared_ptr(const weak_ptr<_Tp>& __r, std::nothrow_t)
       ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:352:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/7/bits/shared_ptr.h:342:2: note: candidate: template<class _Alloc, class ... _Args> std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...)
  shared_ptr(_Sp_make_shared_tag __tag, const _Alloc& __a,
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:342:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:75:38: note:   candidate expects at least 2 arguments, 1 provided
     return std::make_shared<Circle>(r);
                                      ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:294:17: note: candidate: constexpr std::shared_ptr<_Tp>::shared_ptr(std::nullptr_t) [with _Tp = Rect; std::nullptr_t = std::nullptr_t]
       constexpr shared_ptr(nullptr_t) noexcept : shared_ptr() { }
                 ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:294:17: note:   no known conversion for argument 1 from 'std::shared_ptr<Circle>' to 'std::nullptr_t'
/usr/include/c++/7/bits/shared_ptr.h:286:2: note: candidate: template<class _Yp, class _Del, std::shared_ptr<Rect>::_Constructible<std::unique_ptr<_Tp, _Dp>, std::__sp_array_delete>* <anonymous> > std::shared_ptr<_Tp>::shared_ptr(std::unique_ptr<_Up, _Ep>&&)
  shared_ptr(unique_ptr<_Yp, _Del>&& __r)
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:286:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:75:38: note:   'std::shared_ptr<Circle>' is not derived from 'std::unique_ptr<_Tp, _Dp>'
     return std::make_shared<Circle>(r);
                                      ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:277:2: note: candidate: template<class _Yp, class _Del, class> std::shared_ptr<_Tp>::shared_ptr(std::unique_ptr<_Up, _Ep>&&)
  shared_ptr(unique_ptr<_Yp, _Del>&& __r)
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:277:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:75:38: note:   'std::shared_ptr<Circle>' is not derived from 'std::unique_ptr<_Tp, _Dp>'
     return std::make_shared<Circle>(r);
                                      ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:270:2: note: candidate: template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(std::auto_ptr<_Up>&&)
  shared_ptr(auto_ptr<_Yp>&& __r);
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:270:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:75:38: note:   'std::shared_ptr<Circle>' is not derived from 'std::auto_ptr<_Up>'
     return std::make_shared<Circle>(r);
                                      ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:265:11: note: candidate: template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(const std::weak_ptr<_Yp>&)
  explicit shared_ptr(const weak_ptr<_Yp>& __r)
           ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:265:11: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:75:38: note:   'std::shared_ptr<Circle>' is not derived from 'const std::weak_ptr<_Tp>'
     return std::make_shared<Circle>(r);
                                      ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:253:2: note: candidate: template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(std::shared_ptr<_Yp>&&)
  shared_ptr(shared_ptr<_Yp>&& __r) noexcept
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:253:2: note:   template argument deduction/substitution failed:
/usr/include/c++/7/bits/shared_ptr.h:244:7: note: candidate: std::shared_ptr<_Tp>::shared_ptr(std::shared_ptr<_Tp>&&) [with _Tp = Rect]
       shared_ptr(shared_ptr&& __r) noexcept
       ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:244:7: note:   no known conversion for argument 1 from 'std::shared_ptr<Circle>' to 'std::shared_ptr<Rect>&&'
/usr/include/c++/7/bits/shared_ptr.h:236:2: note: candidate: template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(const std::shared_ptr<_Yp>&)
  shared_ptr(const shared_ptr<_Yp>& __r) noexcept
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:236:2: note:   template argument deduction/substitution failed:
/usr/include/c++/7/bits/shared_ptr.h:224:2: note: candidate: template<class _Yp> std::shared_ptr<_Tp>::shared_ptr(const std::shared_ptr<_Yp>&, std::shared_ptr<_Tp>::element_type*)
  shared_ptr(const shared_ptr<_Yp>& __r, element_type* __p) noexcept
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:224:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:75:38: note:   candidate expects 2 arguments, 1 provided
     return std::make_shared<Circle>(r);
                                      ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:202:2: note: candidate: template<class _Deleter, class _Alloc> std::shared_ptr<_Tp>::shared_ptr(std::nullptr_t, _Deleter, _Alloc)
  shared_ptr(nullptr_t __p, _Deleter __d, _Alloc __a)
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:202:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:75:38: note:   candidate expects 3 arguments, 1 provided
     return std::make_shared<Circle>(r);
                                      ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:183:2: note: candidate: template<class _Yp, class _Deleter, class _Alloc, class> std::shared_ptr<_Tp>::shared_ptr(_Yp*, _Deleter, _Alloc)
  shared_ptr(_Yp* __p, _Deleter __d, _Alloc __a)
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:183:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:75:38: note:   mismatched types '_Yp*' and 'std::shared_ptr<Circle>'
     return std::make_shared<Circle>(r);
                                      ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:163:2: note: candidate: template<class _Deleter> std::shared_ptr<_Tp>::shared_ptr(std::nullptr_t, _Deleter)
  shared_ptr(nullptr_t __p, _Deleter __d)
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:163:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:75:38: note:   candidate expects 2 arguments, 1 provided
     return std::make_shared<Circle>(r);
                                      ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:146:2: note: candidate: template<class _Yp, class _Deleter, class> std::shared_ptr<_Tp>::shared_ptr(_Yp*, _Deleter)
  shared_ptr(_Yp* __p, _Deleter __d)
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:146:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:75:38: note:   mismatched types '_Yp*' and 'std::shared_ptr<Circle>'
     return std::make_shared<Circle>(r);
                                      ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:129:2: note: candidate: template<class _Yp, class> std::shared_ptr<_Tp>::shared_ptr(_Yp*)
  shared_ptr(_Yp* __p) : __shared_ptr<_Tp>(__p) { }
  ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:129:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:75:38: note:   mismatched types '_Yp*' and 'std::shared_ptr<Circle>'
     return std::make_shared<Circle>(r);
                                      ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:119:7: note: candidate: std::shared_ptr<_Tp>::shared_ptr(const std::shared_ptr<_Tp>&) [with _Tp = Rect]
       shared_ptr(const shared_ptr&) noexcept = default;
       ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:119:7: note:   no known conversion for argument 1 from 'std::shared_ptr<Circle>' to 'const std::shared_ptr<Rect>&'
/usr/include/c++/7/bits/shared_ptr.h:117:17: note: candidate: constexpr std::shared_ptr<_Tp>::shared_ptr() [with _Tp = Rect]
       constexpr shared_ptr() noexcept : __shared_ptr<_Tp>() { }
                 ^~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:117:17: note:   candidate expects 0 arguments, 1 provided
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:63: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;
                    ^~~~
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 = Triangle; _Args = {double&, double&, double&}; _Tp = Triangle]':
/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 = Triangle; _Args = {double&, double&, double&}; _Tp = Triangle; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<Triangle>]'
/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&, double&}; _Tp = Triangle; _Alloc = std::allocator<Triangle>; __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 = Triangle; _Alloc = std::allocator<Triangle>; _Args = {double&, 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<Triangle>; _Args = {double&, double&, double&}; _Tp = Triangle; __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<Triangle>; _Args = {double&, double&, double&}; _Tp = Triangle]'
/usr/include/c++/7/bits/shared_ptr.h:690:14:   required from 'std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = Triangle; _Alloc = std::allocator<Triangle>; _Args = {double&, double&, double&}]'
/usr/include/c++/7/bits/shared_ptr.h:706:39:   required from 'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = Triangle; _Args = {double&, double&, double&}]'
figure.h:70:50:   required from here
/usr/include/c++/7/ext/new_allocator.h:136:4: error: invalid new-expression of abstract class type 'Triangle'
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:17:0:
figure.h:13:7: note:   because the following virtual functions are pure within 'Triangle':
 class Triangle : 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;
                    ^~~~
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 = Circle; _Args = {double&}; _Tp = Circle]':
/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 = Circle; _Args = {double&}; _Tp = Circle; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<Circle>]'
/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&}; _Tp = Circle; _Alloc = std::allocator<Circle>; __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 = Circle; _Alloc = std::allocator<Circle>; _Args = {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<Circle>; _Args = {double&}; _Tp = Circle; __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<Circle>; _Args = {double&}; _Tp = Circle]'
/usr/include/c++/7/bits/shared_ptr.h:690:14:   required from 'std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = Circle; _Alloc = std::allocator<Circle>; _Args = {double&}]'
/usr/include/c++/7/bits/shared_ptr.h:706:39:   required from 'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = Circle; _Args = {double&}]'
figure.h:75:38:   required from here
/usr/include/c++/7/ext/new_allocator.h:136:4: error: invalid new-expression of abstract class type 'Circle'
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:17:0:
figure.h:44:7: note:   because the following virtual functions are pure within 'Circle':
 class Circle : 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;
                    ^~~~
[печатать | |
]
(1 832 b)
0.104s 0.013s 10