ID 5787882
Пользователь Доманский Игорь Сергеевич
Время 22:51<< 16.11.2021 22:55 (27 д. 20:56) 22:57>>
Обработка 22:55 ... 22:55 (3,17 сек.)
Файл 5787882.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: In member function 'bool smart_pointer::SmartPointer<T, Allocator>::operator==(const smart_pointer::SmartPointer<U, AnotherAllocator>&) const [with U = float; AnotherAllocator = std::allocator<float>; T = float; Allocator = std::allocator<float>]':
SmartPointer.hpp:124:50: error: nonnull argument 'this' compared to NULL [-Werror=nonnull-compare]
         return (reinterpret_cast<void*>(this->get()) ==
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             reinterpret_cast<void*>(other.get()) ||
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
             (!this && !other));
             ~~~~~~~~~~~~~~~~~~                    
SmartPointer.hpp: In member function 'bool smart_pointer::SmartPointer<T, Allocator>::operator!=(const smart_pointer::SmartPointer<U, AnotherAllocator>&) const [with U = float; AnotherAllocator = std::allocator<float>; T = float; Allocator = std::allocator<float>]':
SmartPointer.hpp:131:16: error: nonnull argument 'this' compared to NULL [-Werror=nonnull-compare]
         return !(reinterpret_cast<void*>(this->get()) ==
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             reinterpret_cast<void*>(other.get()) ||
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             (!this && !other));
             ~~~~~~~~~~~~~~~~~~
SmartPointer.hpp: In member function 'bool smart_pointer::SmartPointer<T, Allocator>::operator==(const smart_pointer::SmartPointer<U, AnotherAllocator>&) const [with U = long unsigned int; AnotherAllocator = std::allocator<long unsigned int>; T = float; Allocator = std::allocator<float>]':
SmartPointer.hpp:124:50: error: nonnull argument 'this' compared to NULL [-Werror=nonnull-compare]
         return (reinterpret_cast<void*>(this->get()) ==
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             reinterpret_cast<void*>(other.get()) ||
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
             (!this && !other));
             ~~~~~~~~~~~~~~~~~~                    
SmartPointer.hpp: In member function 'bool smart_pointer::SmartPointer<T, Allocator>::operator!=(const smart_pointer::SmartPointer<U, AnotherAllocator>&) const [with U = long unsigned int; AnotherAllocator = std::allocator<long unsigned int>; T = float; Allocator = std::allocator<float>]':
SmartPointer.hpp:131:16: error: nonnull argument 'this' compared to NULL [-Werror=nonnull-compare]
         return !(reinterpret_cast<void*>(this->get()) ==
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             reinterpret_cast<void*>(other.get()) ||
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             (!this && !other));
             ~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
[печатать | |
]
(3 654 b)
0.084s 0.011s 10