ID 5785568
Пользователь Псарев Александр Павлович
Время 16:13<< 16.11.2021 16:13 (27 д. 14:13) 16:14>>
Обработка 16:13 ... 16:13 (3,10 сек.)
Файл 5785568.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:171:1: error: expected ';' at end of member declaration
 Core *core;
 ^~~~
SmartPointer.hpp:171:7: error: ISO C++ forbids declaration of 'core' with no type [-fpermissive]
 Core *core;
       ^~~~
SmartPointer.hpp: In constructor 'smart_pointer::SmartPointer<T, Allocator>::SmartPointer(smart_pointer::SmartPointer<T, Allocator>::value_type*)':
SmartPointer.hpp:29:18: error: expected type-specifier before 'Core'
 this->core = new Core();
                  ^~~~
SmartPointer.hpp:29:18: error: expected ';' before 'Core'
SmartPointer.hpp:30:13: error: request for member 'pointer' in '((smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 this->core->pointer = value;
             ^~~~~~~
SmartPointer.hpp:31:13: error: request for member 'count' in '((smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 this->core->count = 1;
             ^~~~~
SmartPointer.hpp: In copy constructor 'smart_pointer::SmartPointer<T, Allocator>::SmartPointer(const smart_pointer::SmartPointer<T, Allocator>&)':
SmartPointer.hpp:38:13: error: request for member 'count' in '((smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 this->core->count++;
             ^~~~~
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>& smart_pointer::SmartPointer<T, Allocator>::operator=(const smart_pointer::SmartPointer<T, Allocator>&)':
SmartPointer.hpp:48:17: error: request for member 'count' in '((smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 if (this->core->count > 1) {
                 ^~~~~
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>& smart_pointer::SmartPointer<T, Allocator>::operator=(smart_pointer::SmartPointer<T, Allocator>&&)':
SmartPointer.hpp:59:17: error: request for member 'count' in '((smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 if (this->core->count > 1) {
                 ^~~~~
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>& smart_pointer::SmartPointer<T, Allocator>::operator=(smart_pointer::SmartPointer<T, Allocator>::value_type*)':
SmartPointer.hpp:72:17: error: request for member 'count' in '((smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 if (this->core->count > 1) {
                 ^~~~~
SmartPointer.hpp:74:18: error: expected type-specifier before 'Core'
 this->core = new Core();
                  ^~~~
SmartPointer.hpp:74:18: error: expected ';' before 'Core'
SmartPointer.hpp:75:13: error: request for member 'pointer' in '((smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 this->core->pointer = obj;
             ^~~~~~~
SmartPointer.hpp:76:13: error: request for member 'count' in '((smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 this->core->count = 1;
             ^~~~~
SmartPointer.hpp:84:18: error: expected type-specifier before 'Core'
 this->core = new Core();
                  ^~~~
SmartPointer.hpp:84:18: error: expected ';' before 'Core'
SmartPointer.hpp:85:13: error: request for member 'pointer' in '((smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 this->core->pointer = obj;
             ^~~~~~~
SmartPointer.hpp:86:13: error: request for member 'count' in '((smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 this->core->count = 1;
             ^~~~~
SmartPointer.hpp: In destructor 'smart_pointer::SmartPointer<T, Allocator>::~SmartPointer()':
SmartPointer.hpp:94:17: error: request for member 'count' in '((smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 if (this->core->count <= 1) {
                 ^~~~~
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>::value_type& smart_pointer::SmartPointer<T, Allocator>::operator*()':
SmartPointer.hpp:104:22: error: request for member 'ptr' in '((smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 return *(this->core->ptr);
                      ^~~
SmartPointer.hpp: In member function 'const value_type& smart_pointer::SmartPointer<T, Allocator>::operator*() const':
SmartPointer.hpp:111:22: error: request for member 'ptr' in '((const smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 return *(this->core->ptr);
                      ^~~
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>::value_type* smart_pointer::SmartPointer<T, Allocator>::operator->() const':
SmartPointer.hpp:119:20: error: request for member 'pointer' in '((const smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 return this->core->pointer;
                    ^~~~~~~
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>::value_type* smart_pointer::SmartPointer<T, Allocator>::get() const':
SmartPointer.hpp:126:20: error: request for member 'pointer' in '((const smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 return this->core->pointer;
                    ^~~~~~~
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>::operator bool() const':
SmartPointer.hpp:131:16: error: request for member 'pointer' in '((const smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 if(this->core->pointer == nullptr) {
                ^~~~~~~
SmartPointer.hpp: In member function 'std::size_t smart_pointer::SmartPointer<T, Allocator>::count_owners() const':
SmartPointer.hpp:159:20: error: request for member 'count' in '((const smart_pointer::SmartPointer<T, Allocator>*)this)->core->', which is of non-class type 'int'
 return this->core->count;
                    ^~~~~
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>& smart_pointer::SmartPointer<T, Allocator>::operator=(const smart_pointer::SmartPointer<T, Allocator>&) [with T = float; Allocator = std::allocator<float>]':
SmartPointer.hpp:56:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>& smart_pointer::SmartPointer<T, Allocator>::operator=(smart_pointer::SmartPointer<T, Allocator>&&) [with T = float; Allocator = std::allocator<float>]':
SmartPointer.hpp:69:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>& smart_pointer::SmartPointer<T, Allocator>::operator=(smart_pointer::SmartPointer<T, Allocator>::value_type*) [with T = float; Allocator = std::allocator<float>]':
SmartPointer.hpp:92:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>::operator bool() const [with T = float; Allocator = std::allocator<float>]':
SmartPointer.hpp:136:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1plus: all warnings being treated as errors
0.074s 0.021s 9