ID 5769782
Пользователь Корягин Роман Сергеевич
Время 13:58<< 14.11.2021 13:59 (25 д. 11:59) 14:05>>
Обработка 13:59 ... 13:59 (4,02 сек.)
Файл 5769782.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 2, осень 2021
Задача C: Smart Pointer
Набор тестов
Ограничения Время: 25с Память: 512Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
In file included from main.cpp:2:0:
SmartPointer.hpp:52:15: error: 'smart_pointer::SmartPointer<T, Allocator>& smart_pointer::SmartPointer<T, Allocator>::operator=(smart_pointer::SmartPointer<T, Allocator>&&)' cannot be overloaded
 SmartPointer& operator=(SmartPointer&& x) {
               ^~~~~~~~
SmartPointer.hpp:41:15: error: with 'smart_pointer::SmartPointer<T, Allocator>& smart_pointer::SmartPointer<T, Allocator>::operator=(smart_pointer::SmartPointer<T, Allocator>&&)'
 SmartPointer& operator=(SmartPointer&& x) {
               ^~~~~~~~
In file included from main.cpp:3:0:
Test_SmartPointer.hpp: In function 'void test::test(const string&) [with __TEST_CLASSNAME__ = smart_pointer::SmartPointer<float, std::allocator<float> >; std::__cxx11::string = std::__cxx11::basic_string<char>]':
Test_SmartPointer.hpp:139:17: error: use of deleted function 'constexpr smart_pointer::SmartPointer<float, std::allocator<float> >& smart_pointer::SmartPointer<float, std::allocator<float> >::operator=(const smart_pointer::SmartPointer<float, std::allocator<float> >&)'
         sptr2 = sptr1;
                 ^~~~~
In file included from main.cpp:2:0:
SmartPointer.hpp:15:7: note: 'constexpr smart_pointer::SmartPointer<float, std::allocator<float> >& smart_pointer::SmartPointer<float, std::allocator<float> >::operator=(const smart_pointer::SmartPointer<float, std::allocator<float> >&)' is implicitly declared as deleted because 'smart_pointer::SmartPointer<float, std::allocator<float> >' declares a move constructor or move assignment operator
 class SmartPointer {
       ^~~~~~~~~~~~
In file included from main.cpp:3:0:
Test_SmartPointer.hpp:147:17: error: use of deleted function 'constexpr smart_pointer::SmartPointer<float, std::allocator<float> >& smart_pointer::SmartPointer<float, std::allocator<float> >::operator=(const smart_pointer::SmartPointer<float, std::allocator<float> >&)'
         sptr2 = sptr1;
                 ^~~~~
Test_SmartPointer.hpp:155:17: error: use of deleted function 'constexpr smart_pointer::SmartPointer<float, std::allocator<float> >& smart_pointer::SmartPointer<float, std::allocator<float> >::operator=(const smart_pointer::SmartPointer<float, std::allocator<float> >&)'
         sptr2 = sptr1;
                 ^~~~~
Test_SmartPointer.hpp:164:17: error: use of deleted function 'constexpr smart_pointer::SmartPointer<float, std::allocator<float> >& smart_pointer::SmartPointer<float, std::allocator<float> >::operator=(const smart_pointer::SmartPointer<float, std::allocator<float> >&)'
         sptr2 = sptr1;
                 ^~~~~
Test_SmartPointer.hpp:176:21: error: use of deleted function 'constexpr smart_pointer::SmartPointer<float, std::allocator<float> >& smart_pointer::SmartPointer<float, std::allocator<float> >::operator=(const smart_pointer::SmartPointer<float, std::allocator<float> >&)'
             sptr2 = sptr1;
                     ^~~~~
In file included from main.cpp:2:0:
SmartPointer.hpp: In instantiation of 'smart_pointer::SmartPointer<T, Allocator>::Core::Core(smart_pointer::SmartPointer<T, Allocator>::value_type*, size_t) [with T = float; Allocator = std::allocator<float>; smart_pointer::SmartPointer<T, Allocator>::value_type = float; size_t = long unsigned int]':
SmartPointer.hpp:25:14:   required from 'smart_pointer::SmartPointer<T, Allocator>::SmartPointer(smart_pointer::SmartPointer<T, Allocator>::value_type*) [with T = float; Allocator = std::allocator<float>; smart_pointer::SmartPointer<T, Allocator>::value_type = float]'
Test_SmartPointer.hpp:103:30:   required from here
SmartPointer.hpp:136:13: error: 'smart_pointer::SmartPointer<float, std::allocator<float> >::Core::ptr' will be initialized after [-Werror=reorder]
 value_type* ptr;
             ^~~
SmartPointer.hpp:135:8: error:   'size_t smart_pointer::SmartPointer<float, std::allocator<float> >::Core::ref_count' [-Werror=reorder]
 size_t ref_count;
        ^~~~~~~~~
SmartPointer.hpp:141:1: error:   when initialized here [-Werror=reorder]
 Core(value_type* ptr, size_t ref_count) : ptr(ptr), ref_count(ref_count) {
 ^~~~
SmartPointer.hpp: In instantiation of 'smart_pointer::SmartPointer<T, Allocator>::Core::Core(smart_pointer::SmartPointer<T, Allocator>::value_type*, size_t) [with T = long unsigned int; Allocator = std::allocator<long unsigned int>; smart_pointer::SmartPointer<T, Allocator>::value_type = long unsigned int; size_t = long unsigned int]':
SmartPointer.hpp:25:14:   required from 'smart_pointer::SmartPointer<T, Allocator>::SmartPointer(smart_pointer::SmartPointer<T, Allocator>::value_type*) [with T = long unsigned int; Allocator = std::allocator<long unsigned int>; smart_pointer::SmartPointer<T, Allocator>::value_type = long unsigned int]'
Test_SmartPointer.hpp:304:38:   required from here
SmartPointer.hpp:136:13: error: 'smart_pointer::SmartPointer<long unsigned int, std::allocator<long unsigned int> >::Core::ptr' will be initialized after [-Werror=reorder]
 value_type* ptr;
             ^~~
SmartPointer.hpp:135:8: error:   'size_t smart_pointer::SmartPointer<long unsigned int, std::allocator<long unsigned int> >::Core::ref_count' [-Werror=reorder]
 size_t ref_count;
        ^~~~~~~~~
SmartPointer.hpp:141:1: error:   when initialized here [-Werror=reorder]
 Core(value_type* ptr, size_t ref_count) : ptr(ptr), ref_count(ref_count) {
 ^~~~
cc1plus: all warnings being treated as errors
[печатать | |
]
(2 944 b)
0.093s 0.009s 10