ID 5787182
Пользователь Росляков Владимир Олегович
Время 20:50<< 16.11.2021 20:52 (27 д. 18:53) 20:53>>
Обработка 20:52 ... 20:52 (1,61 сек.)
Файл 5787182.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 constructor 'smart_pointer::SmartPointer<T, Allocator>::Core::Core(smart_pointer::SmartPointer<T, Allocator>::value_type*)':
SmartPointer.hpp:132:40: error: class 'smart_pointer::SmartPointer<T, Allocator>::Core' does not have any field named 'value_'
     explicit Core(value_type *value) : value_(value), count_owners_(0) {
                                        ^~~~~~
SmartPointer.hpp:132:55: error: class 'smart_pointer::SmartPointer<T, Allocator>::Core' does not have any field named 'count_owners_'
     explicit Core(value_type *value) : value_(value), count_owners_(0) {
                                                       ^~~~~~~~~~~~~
SmartPointer.hpp: In instantiation of 'void smart_pointer::SmartPointer<T, Allocator>::Core::Decrement() [with T = float; Allocator = std::allocator<float>]':
SmartPointer.hpp:69:7:   required from 'smart_pointer::SmartPointer<T, Allocator>::~SmartPointer() [with T = float; Allocator = std::allocator<float>]'
Test_SmartPointer.hpp:103:30:   required from here
SmartPointer.hpp:154:7: error: invalid use of non-static data member 'smart_pointer::SmartPointer<float, std::allocator<float> >::count_owners_'
       count_owners_--;
       ^~~~~~~~~~~~~
SmartPointer.hpp:21:15: note: declared here
   std::size_t count_owners_;
               ^~~~~~~~~~~~~
SmartPointer.hpp: In instantiation of 'std::size_t smart_pointer::SmartPointer<T, Allocator>::Core::CountOwners() const [with T = float; Allocator = std::allocator<float>; std::size_t = long unsigned int]':
SmartPointer.hpp:70:31:   required from 'smart_pointer::SmartPointer<T, Allocator>::~SmartPointer() [with T = float; Allocator = std::allocator<float>]'
Test_SmartPointer.hpp:103:30:   required from here
SmartPointer.hpp:158:14: error: invalid use of non-static data member 'smart_pointer::SmartPointer<float, std::allocator<float> >::count_owners_'
       return count_owners_;
              ^~~~~~~~~~~~~
SmartPointer.hpp:21:15: note: declared here
   std::size_t count_owners_;
               ^~~~~~~~~~~~~
SmartPointer.hpp: In instantiation of 'smart_pointer::SmartPointer<T, Allocator>::Core::~Core() [with T = float; Allocator = std::allocator<float>]':
SmartPointer.hpp:71:9:   required from 'smart_pointer::SmartPointer<T, Allocator>::~SmartPointer() [with T = float; Allocator = std::allocator<float>]'
Test_SmartPointer.hpp:103:30:   required from here
SmartPointer.hpp:137:14: error: invalid use of non-static data member 'smart_pointer::SmartPointer<float, std::allocator<float> >::value_'
       delete value_;
              ^~~~~~
SmartPointer.hpp:20:15: note: declared here
   value_type *value_;
               ^~~~~~
SmartPointer.hpp:138:7: error: invalid use of non-static data member 'smart_pointer::SmartPointer<float, std::allocator<float> >::value_'
       value_ = nullptr;
       ^~~~~~
SmartPointer.hpp:20:15: note: declared here
   value_type *value_;
               ^~~~~~
SmartPointer.hpp: In instantiation of 'void smart_pointer::SmartPointer<T, Allocator>::Core::Increment() [with T = float; Allocator = std::allocator<float>]':
SmartPointer.hpp:35:7:   required from 'smart_pointer::SmartPointer<T, Allocator>::SmartPointer(const smart_pointer::SmartPointer<T, Allocator>&) [with T = float; Allocator = std::allocator<float>]'
Test_SmartPointer.hpp:114:48:   required from here
SmartPointer.hpp:150:7: error: invalid use of non-static data member 'smart_pointer::SmartPointer<float, std::allocator<float> >::count_owners_'
       count_owners_++;
       ^~~~~~~~~~~~~
SmartPointer.hpp:21:15: note: declared here
   std::size_t count_owners_;
               ^~~~~~~~~~~~~
SmartPointer.hpp: In instantiation of 'smart_pointer::SmartPointer<T, Allocator>::value_type* smart_pointer::SmartPointer<T, Allocator>::Core::Value() [with T = float; Allocator = std::allocator<float>; smart_pointer::SmartPointer<T, Allocator>::value_type = float]':
SmartPointer.hpp:84:12:   required from 'const value_type& smart_pointer::SmartPointer<T, Allocator>::operator*() const [with T = float; Allocator = std::allocator<float>; smart_pointer::SmartPointer<T, Allocator>::value_type = float]'
Test_SmartPointer.hpp:233:9:   required from here
SmartPointer.hpp:142:14: error: invalid use of non-static data member 'smart_pointer::SmartPointer<float, std::allocator<float> >::value_'
       return value_;
              ^~~~~~
SmartPointer.hpp:20:15: note: declared here
   value_type *value_;
               ^~~~~~
SmartPointer.hpp: In instantiation of 'void smart_pointer::SmartPointer<T, Allocator>::Core::Decrement() [with T = long unsigned int; Allocator = std::allocator<long unsigned int>]':
SmartPointer.hpp:69:7:   required from 'smart_pointer::SmartPointer<T, Allocator>::~SmartPointer() [with T = long unsigned int; Allocator = std::allocator<long unsigned int>]'
Test_SmartPointer.hpp:304:38:   required from here
SmartPointer.hpp:154:7: error: invalid use of non-static data member 'smart_pointer::SmartPointer<long unsigned int, std::allocator<long unsigned int> >::count_owners_'
       count_owners_--;
       ^~~~~~~~~~~~~
SmartPointer.hpp:21:15: note: declared here
   std::size_t count_owners_;
               ^~~~~~~~~~~~~
SmartPointer.hpp: In instantiation of 'std::size_t smart_pointer::SmartPointer<T, Allocator>::Core::CountOwners() const [with T = long unsigned int; Allocator = std::allocator<long unsigned int>; std::size_t = long unsigned int]':
SmartPointer.hpp:70:31:   required from 'smart_pointer::SmartPointer<T, Allocator>::~SmartPointer() [with T = long unsigned int; Allocator = std::allocator<long unsigned int>]'
Test_SmartPointer.hpp:304:38:   required from here
SmartPointer.hpp:158:14: error: invalid use of non-static data member 'smart_pointer::SmartPointer<long unsigned int, std::allocator<long unsigned int> >::count_owners_'
       return count_owners_;
              ^~~~~~~~~~~~~
SmartPointer.hpp:21:15: note: declared here
   std::size_t count_owners_;
               ^~~~~~~~~~~~~
SmartPointer.hpp: In instantiation of 'smart_pointer::SmartPointer<T, Allocator>::Core::~Core() [with T = long unsigned int; Allocator = std::allocator<long unsigned int>]':
SmartPointer.hpp:71:9:   required from 'smart_pointer::SmartPointer<T, Allocator>::~SmartPointer() [with T = long unsigned int; Allocator = std::allocator<long unsigned int>]'
Test_SmartPointer.hpp:304:38:   required from here
SmartPointer.hpp:137:14: error: invalid use of non-static data member 'smart_pointer::SmartPointer<long unsigned int, std::allocator<long unsigned int> >::value_'
       delete value_;
              ^~~~~~
SmartPointer.hpp:20:15: note: declared here
   value_type *value_;
               ^~~~~~
SmartPointer.hpp:138:7: error: invalid use of non-static data member 'smart_pointer::SmartPointer<long unsigned int, std::allocator<long unsigned int> >::value_'
       value_ = nullptr;
       ^~~~~~
SmartPointer.hpp:20:15: note: declared here
   value_type *value_;
               ^~~~~~
SmartPointer.hpp: In instantiation of 'void smart_pointer::SmartPointer<T, Allocator>::Core::Increment() [with T = long unsigned int; Allocator = std::allocator<long unsigned int>]':
SmartPointer.hpp:133:16:   required from 'smart_pointer::SmartPointer<T, Allocator>::Core::Core(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]'
SmartPointer.hpp:26: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:150:7: error: invalid use of non-static data member 'smart_pointer::SmartPointer<long unsigned int, std::allocator<long unsigned int> >::count_owners_'
       count_owners_++;
       ^~~~~~~~~~~~~
SmartPointer.hpp:21:15: note: declared here
   std::size_t count_owners_;
               ^~~~~~~~~~~~~
SmartPointer.hpp: In instantiation of 'smart_pointer::SmartPointer<T, Allocator>::value_type* smart_pointer::SmartPointer<T, Allocator>::Core::Value() [with T = long unsigned int; Allocator = std::allocator<long unsigned int>; smart_pointer::SmartPointer<T, Allocator>::value_type = long unsigned int]':
SmartPointer.hpp:101:47:   required from 'smart_pointer::SmartPointer<T, Allocator>::operator bool() const [with T = long unsigned int; Allocator = std::allocator<long unsigned int>]'
SmartPointer.hpp:68:5:   required from 'smart_pointer::SmartPointer<T, Allocator>::~SmartPointer() [with T = long unsigned int; Allocator = std::allocator<long unsigned int>]'
Test_SmartPointer.hpp:304:38:   required from here
SmartPointer.hpp:142:14: error: invalid use of non-static data member 'smart_pointer::SmartPointer<long unsigned int, std::allocator<long unsigned int> >::value_'
       return value_;
              ^~~~~~
SmartPointer.hpp:20:15: note: declared here
   value_type *value_;
               ^~~~~~
0.033s 0.008s 9