ID 5785577
Пользователь Псарев Александр Павлович
Время 16:14<< 16.11.2021 16:15 (27 д. 14:16) 16:16>>
Обработка 16:15 ... 16:15 (3,47 сек.)
Файл 5785577.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:155:1: error: expected ';' at end of member declaration
 Core *core;
 ^~~~
SmartPointer.hpp:155: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:26:18: error: expected type-specifier before 'Core'
 this->core = new Core();
                  ^~~~
SmartPointer.hpp:26:18: error: expected ';' before 'Core'
SmartPointer.hpp:27: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:28: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:34: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:42: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:52: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:64: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:66:18: error: expected type-specifier before 'Core'
 this->core = new Core();
                  ^~~~
SmartPointer.hpp:66:18: error: expected ';' before 'Core'
SmartPointer.hpp:67: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:68: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:76:18: error: expected type-specifier before 'Core'
 this->core = new Core();
                  ^~~~
SmartPointer.hpp:76:18: error: expected ';' before 'Core'
SmartPointer.hpp:77: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:78: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:86: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:94: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:101: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:108: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:115: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:119: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:143: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:50: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:62: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:84: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:124:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1plus: all warnings being treated as errors
0.124s 0.008s 9