ID 5773520
Пользователь Крюков Никита Владимирович
Время 20:28<< 14.11.2021 20:28 (25 д. 18:29) 21:43>>
Обработка 20:28 ... 20:28 (2,31 сек.)
Файл 5773520.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 '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) {
                         ^~~~~~~~~~~~
[печатать | |
]
(1 917 b)
1.610s 0.017s 10