ID 5769800
Пользователь Корягин Роман Сергеевич
Время 14:06<< 14.11.2021 14:07 (25 д. 12:07) 14:07>>
Обработка 14:07 ... 14:07 (3,66 сек.)
Файл 5769800.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 'smart_pointer::SmartPointer<T, Allocator>& smart_pointer::SmartPointer<T, Allocator>::operator=(const smart_pointer::SmartPointer<T, Allocator>&)':
SmartPointer.hpp:50:12: error: 'ref_count' was not declared in this scope
 this->core-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 = 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:138:13: error: 'smart_pointer::SmartPointer<float, std::allocator<float> >::Core::ptr' will be initialized after [-Werror=reorder]
 value_type* ptr;
             ^~~
SmartPointer.hpp:137:8: error:   'size_t smart_pointer::SmartPointer<float, std::allocator<float> >::Core::ref_count' [-Werror=reorder]
 size_t ref_count;
        ^~~~~~~~~
SmartPointer.hpp:143: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:138: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:137: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:143: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 984 b)
0.058s 0.016s 10