ID 5773455
User Крюков Никита Владимирович
Time 20:18<< 14.11.2021 20:18 (25天 18:19) 20:28>>
Processing 20:18 ... 20:18 (3,63 秒)
File 5773455.cpp (CLang++ 5.0.0 + Address Sanitizer)
Contest 2 курс. Программирование на C++. Турнир 2, осень 2021
Problem A: Набор фигур
Testset
Limits Time: 1s Memory: 4096Mb
Status  [?]
CE Compilation error
source | results
In file included from main.cpp:17:0:
figure.h: In function 'std::shared_ptr<Figure> CreateFigure(std::istringstream)':
figure.h:72:44: error: no match for 'operator=' (operand types are 'std::shared_ptr<Figure>' and 'std::shared_ptr<Triangle>')
         res = 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:296:19: note: candidate: std::shared_ptr<_Tp>& std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Tp>&) [with _Tp = Figure]
       shared_ptr& operator=(const shared_ptr&) noexcept = default;
                   ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:296:19: note:   no known conversion for argument 1 from 'std::shared_ptr<Triangle>' to 'const std::shared_ptr<Figure>&'
/usr/include/c++/7/bits/shared_ptr.h:300:2: note: candidate: template<class _Yp> std::shared_ptr<_Tp>::_Assignable<const std::shared_ptr<_Yp>&> std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Yp>&) [with _Yp = _Yp; _Tp = Figure]
  operator=(const shared_ptr<_Yp>& __r) noexcept
  ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:300:2: note:   template argument deduction/substitution failed:
/usr/include/c++/7/bits/shared_ptr.h:309:2: note: candidate: template<class _Yp> std::shared_ptr<_Tp>::_Assignable<std::auto_ptr<_Up> > std::shared_ptr<_Tp>::operator=(std::auto_ptr<_Up>&&) [with _Yp = _Yp; _Tp = Figure]
  operator=(auto_ptr<_Yp>&& __r)
  ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:309:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:72:44: note:   'std::shared_ptr<Triangle>' is not derived from 'std::auto_ptr<_Up>'
         res = 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:317:7: note: candidate: std::shared_ptr<_Tp>& std::shared_ptr<_Tp>::operator=(std::shared_ptr<_Tp>&&) [with _Tp = Figure]
       operator=(shared_ptr&& __r) noexcept
       ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:317:7: note:   no known conversion for argument 1 from 'std::shared_ptr<Triangle>' to 'std::shared_ptr<Figure>&&'
/usr/include/c++/7/bits/shared_ptr.h:325:2: note: candidate: template<class _Yp> std::shared_ptr<_Tp>::_Assignable<std::shared_ptr<_Yp> > std::shared_ptr<_Tp>::operator=(std::shared_ptr<_Yp>&&) [with _Yp = _Yp; _Tp = Figure]
  operator=(shared_ptr<_Yp>&& __r) noexcept
  ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:325:2: note:   template argument deduction/substitution failed:
/usr/include/c++/7/bits/shared_ptr.h:333:2: note: candidate: template<class _Yp, class _Del> std::shared_ptr<_Tp>::_Assignable<std::unique_ptr<_Up, _Ep> > std::shared_ptr<_Tp>::operator=(std::unique_ptr<_Up, _Ep>&&) [with _Yp = _Yp; _Del = _Del; _Tp = Figure]
  operator=(unique_ptr<_Yp, _Del>&& __r)
  ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:333:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:72:44: note:   'std::shared_ptr<Triangle>' is not derived from 'std::unique_ptr<_Tp, _Dp>'
         res = make_shared<Triangle>(a, b, c);
                                            ^
figure.h:76:37: error: no match for 'operator=' (operand types are 'std::shared_ptr<Figure>' and 'std::shared_ptr<Rect>')
         res = make_shared<Rect>(a, b);
                                     ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:296:19: note: candidate: std::shared_ptr<_Tp>& std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Tp>&) [with _Tp = Figure]
       shared_ptr& operator=(const shared_ptr&) noexcept = default;
                   ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:296:19: note:   no known conversion for argument 1 from 'std::shared_ptr<Rect>' to 'const std::shared_ptr<Figure>&'
/usr/include/c++/7/bits/shared_ptr.h:300:2: note: candidate: template<class _Yp> std::shared_ptr<_Tp>::_Assignable<const std::shared_ptr<_Yp>&> std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Yp>&) [with _Yp = _Yp; _Tp = Figure]
  operator=(const shared_ptr<_Yp>& __r) noexcept
  ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:300:2: note:   template argument deduction/substitution failed:
/usr/include/c++/7/bits/shared_ptr.h:309:2: note: candidate: template<class _Yp> std::shared_ptr<_Tp>::_Assignable<std::auto_ptr<_Up> > std::shared_ptr<_Tp>::operator=(std::auto_ptr<_Up>&&) [with _Yp = _Yp; _Tp = Figure]
  operator=(auto_ptr<_Yp>&& __r)
  ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:309:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:76:37: note:   'std::shared_ptr<Rect>' is not derived from 'std::auto_ptr<_Up>'
         res = make_shared<Rect>(a, b);
                                     ^
In file included from /usr/include/c++/7/memory:81:0,
                 from main.cpp:12:
/usr/include/c++/7/bits/shared_ptr.h:317:7: note: candidate: std::shared_ptr<_Tp>& std::shared_ptr<_Tp>::operator=(std::shared_ptr<_Tp>&&) [with _Tp = Figure]
       operator=(shared_ptr&& __r) noexcept
       ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:317:7: note:   no known conversion for argument 1 from 'std::shared_ptr<Rect>' to 'std::shared_ptr<Figure>&&'
/usr/include/c++/7/bits/shared_ptr.h:325:2: note: candidate: template<class _Yp> std::shared_ptr<_Tp>::_Assignable<std::shared_ptr<_Yp> > std::shared_ptr<_Tp>::operator=(std::shared_ptr<_Yp>&&) [with _Yp = _Yp; _Tp = Figure]
  operator=(shared_ptr<_Yp>&& __r) noexcept
  ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:325:2: note:   template argument deduction/substitution failed:
/usr/include/c++/7/bits/shared_ptr.h:333:2: note: candidate: template<class _Yp, class _Del> std::shared_ptr<_Tp>::_Assignable<std::unique_ptr<_Up, _Ep> > std::shared_ptr<_Tp>::operator=(std::unique_ptr<_Up, _Ep>&&) [with _Yp = _Yp; _Del = _Del; _Tp = Figure]
  operator=(unique_ptr<_Yp, _Del>&& __r)
  ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:333:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:76:37: note:   'std::shared_ptr<Rect>' is not derived from 'std::unique_ptr<_Tp, _Dp>'
         res = make_shared<Rect>(a, b);
                                     ^
figure.h:80:36: error: no match for 'operator=' (operand types are 'std::shared_ptr<Figure>' and 'std::shared_ptr<Circle>')
         res = 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:296:19: note: candidate: std::shared_ptr<_Tp>& std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Tp>&) [with _Tp = Figure]
       shared_ptr& operator=(const shared_ptr&) noexcept = default;
                   ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:296:19: note:   no known conversion for argument 1 from 'std::shared_ptr<Circle>' to 'const std::shared_ptr<Figure>&'
/usr/include/c++/7/bits/shared_ptr.h:300:2: note: candidate: template<class _Yp> std::shared_ptr<_Tp>::_Assignable<const std::shared_ptr<_Yp>&> std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Yp>&) [with _Yp = _Yp; _Tp = Figure]
  operator=(const shared_ptr<_Yp>& __r) noexcept
  ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:300:2: note:   template argument deduction/substitution failed:
/usr/include/c++/7/bits/shared_ptr.h:309:2: note: candidate: template<class _Yp> std::shared_ptr<_Tp>::_Assignable<std::auto_ptr<_Up> > std::shared_ptr<_Tp>::operator=(std::auto_ptr<_Up>&&) [with _Yp = _Yp; _Tp = Figure]
  operator=(auto_ptr<_Yp>&& __r)
  ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:309:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:80:36: note:   'std::shared_ptr<Circle>' is not derived from 'std::auto_ptr<_Up>'
         res = 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:317:7: note: candidate: std::shared_ptr<_Tp>& std::shared_ptr<_Tp>::operator=(std::shared_ptr<_Tp>&&) [with _Tp = Figure]
       operator=(shared_ptr&& __r) noexcept
       ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:317:7: note:   no known conversion for argument 1 from 'std::shared_ptr<Circle>' to 'std::shared_ptr<Figure>&&'
/usr/include/c++/7/bits/shared_ptr.h:325:2: note: candidate: template<class _Yp> std::shared_ptr<_Tp>::_Assignable<std::shared_ptr<_Yp> > std::shared_ptr<_Tp>::operator=(std::shared_ptr<_Yp>&&) [with _Yp = _Yp; _Tp = Figure]
  operator=(shared_ptr<_Yp>&& __r) noexcept
  ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:325:2: note:   template argument deduction/substitution failed:
/usr/include/c++/7/bits/shared_ptr.h:333:2: note: candidate: template<class _Yp, class _Del> std::shared_ptr<_Tp>::_Assignable<std::unique_ptr<_Up, _Ep> > std::shared_ptr<_Tp>::operator=(std::unique_ptr<_Up, _Ep>&&) [with _Yp = _Yp; _Del = _Del; _Tp = Figure]
  operator=(unique_ptr<_Yp, _Del>&& __r)
  ^~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:333:2: note:   template argument deduction/substitution failed:
In file included from main.cpp:17:0:
figure.h:80:36: note:   'std::shared_ptr<Circle>' is not derived from 'std::unique_ptr<_Tp, _Dp>'
         res = make_shared<Circle>(r);
                                    ^
main.cpp: In function 'int main()':
main.cpp:33:37: error: use of deleted function 'std::__cxx11::basic_istringstream<_CharT, _Traits, _Alloc>::basic_istringstream(const std::__cxx11::basic_istringstream<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
    figures.push_back(CreateFigure(is));
                                     ^
In file included from /usr/include/c++/7/bits/quoted_string.h:38:0,
                 from /usr/include/c++/7/iomanip:45,
                 from main.cpp:14:
/usr/include/c++/7/sstream:449:7: note: declared here
       basic_istringstream(const basic_istringstream&) = delete;
       ^~~~~~~~~~~~~~~~~~~
In file included from main.cpp:17:0:
figure.h:65:25: note:   initializing argument 1 of 'std::shared_ptr<Figure> CreateFigure(std::istringstream)'
 std::shared_ptr<Figure> CreateFigure(std::istringstream stream) {
                         ^~~~~~~~~~~~
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 = {int&, int&, int&}; _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 = {int&, int&, int&}; _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 = {int&, int&, int&}; _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 = {int&, int&, int&}; __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 = {int&, int&, int&}; _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 = {int&, int&, int&}; _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 = {int&, int&, int&}]'
/usr/include/c++/7/bits/shared_ptr.h:706:39:   required from 'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = Triangle; _Args = {int&, int&, int&}]'
figure.h:72:44:   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:15:7: note:   because the following virtual functions are pure within 'Triangle':
 class Triangle : Figure {
       ^~~~~~~~
figure.h:9:20: note: 	virtual std::__cxx11::string Figure::Name() const
     virtual string Name() const = 0;
                    ^~~~
figure.h:10:20: note: 	virtual double Figure::Perimeter() const
     virtual double Perimeter() const = 0;
                    ^~~~~~~~~
figure.h:11: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 = Rect; _Args = {int&, int&}; _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 = {int&, int&}; _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 = {int&, int&}; _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 = {int&, int&}; __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 = {int&, int&}; _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 = {int&, int&}; _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 = {int&, int&}]'
/usr/include/c++/7/bits/shared_ptr.h:706:39:   required from 'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = Rect; _Args = {int&, int&}]'
figure.h:76:37:   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:33:7: note:   because the following virtual functions are pure within 'Rect':
 class Rect : Figure {
       ^~~~
figure.h:9:20: note: 	virtual std::__cxx11::string Figure::Name() const
     virtual string Name() const = 0;
                    ^~~~
figure.h:10:20: note: 	virtual double Figure::Perimeter() const
     virtual double Perimeter() const = 0;
                    ^~~~~~~~~
figure.h:11: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 = {int&}; _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 = {int&}; _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 = {int&}; _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 = {int&}; __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 = {int&}; _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 = {int&}; _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 = {int&}]'
/usr/include/c++/7/bits/shared_ptr.h:706:39:   required from 'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = Circle; _Args = {int&}]'
figure.h:80:36:   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:49:7: note:   because the following virtual functions are pure within 'Circle':
 class Circle : Figure {
       ^~~~~~
figure.h:9:20: note: 	virtual std::__cxx11::string Figure::Name() const
     virtual string Name() const = 0;
                    ^~~~
figure.h:10:20: note: 	virtual double Figure::Perimeter() const
     virtual double Perimeter() const = 0;
                    ^~~~~~~~~
figure.h:11:20: note: 	virtual double Figure::Area() const
     virtual double Area() const = 0;
                    ^~~~
[打印 | |
]
(1 869 b)
0.047s 0.010s 10