ID 5786405
Пользователь Павленко Георгий Александрович
Время 19:30<< 16.11.2021 19:33 (27 д. 17:33) 19:35>>
Обработка 19:33 ... 19:33 (2,70 сек.)
Файл 5786405.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':
SmartPointer.hpp:140:3: error: expected ',' or ';' before 'return'
   return exp1 || exp2;
   ^~~~~~
SmartPointer.hpp:141:1: error: no return statement in function returning non-void [-Werror=return-type]
 }
 ^
SmartPointer.hpp: In member function 'bool smart_pointer::SmartPointer<T, Allocator>::operator!=(const smart_pointer::SmartPointer<U, AnotherAllocator>&) const':
SmartPointer.hpp:149:3: error: expected ',' or ';' before 'return'
   return !(exp1 || exp2);
   ^~~~~~
SmartPointer.hpp:150:1: error: no return statement in function returning non-void [-Werror=return-type]
 }
 ^
SmartPointer.hpp: In instantiation of '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>]':
Test_SmartPointer.hpp:299:9:   required from here
SmartPointer.hpp:137:8: error: unused variable 'exp1' [-Werror=unused-variable]
   auto exp1 = get() == nullptr && val.get() == nullptr;
        ^~~~
SmartPointer.hpp:138:8: error: unused variable 'exp2' [-Werror=unused-variable]
   auto exp2 = static_cast<void*>(get()) == static_cast<void*>(val.get())
        ^~~~
SmartPointer.hpp: In instantiation of '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>]':
Test_SmartPointer.hpp:305:9:   required from here
SmartPointer.hpp:137:8: error: unused variable 'exp1' [-Werror=unused-variable]
   auto exp1 = get() == nullptr && val.get() == nullptr;
        ^~~~
SmartPointer.hpp:138:8: error: unused variable 'exp2' [-Werror=unused-variable]
   auto exp2 = static_cast<void*>(get()) == static_cast<void*>(val.get())
        ^~~~
SmartPointer.hpp: In instantiation of '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>]':
Test_SmartPointer.hpp:349:9:   required from here
SmartPointer.hpp:146:8: error: unused variable 'exp1' [-Werror=unused-variable]
   auto exp1 = get() == nullptr && val.get() == nullptr;
        ^~~~
SmartPointer.hpp:147:8: error: unused variable 'exp2' [-Werror=unused-variable]
   auto exp2 = static_cast<void*>(get()) == static_cast<void*>(val.get())
        ^~~~
SmartPointer.hpp: In instantiation of '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>]':
Test_SmartPointer.hpp:355:9:   required from here
SmartPointer.hpp:146:8: error: unused variable 'exp1' [-Werror=unused-variable]
   auto exp1 = get() == nullptr && val.get() == nullptr;
        ^~~~
SmartPointer.hpp:147:8: error: unused variable 'exp2' [-Werror=unused-variable]
   auto exp2 = static_cast<void*>(get()) == static_cast<void*>(val.get())
        ^~~~
cc1plus: all warnings being treated as errors
[печатать | |
]
(3 173 b)
0.047s 0.011s 10