ID 5787085
Пользователь Зеленский Сергей Максимович
Время 20:43<< 16.11.2021 20:43 (27 д. 18:44) 20:44>>
Обработка 20:43 ... 20:43 (3,31 сек.)
Файл 5787085.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 2, осень 2021
Задача D: FixedAllocator
Набор тестов
Ограничения Время: 2с Память: 128Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
In file included from main.cpp:28:0:
fixed_allocator.h:11:12: error: expected ';' at end of member declaration
   unsigned uint64_t page_size_;
            ^~~~~~~~
fixed_allocator.h:11:21: error: 'page_size_' does not name a type; did you mean '__size_t'?
   unsigned uint64_t page_size_;
                     ^~~~~~~~~~
                     __size_t
fixed_allocator.h: In constructor 'FixedAllocator<Tp>::FixedAllocator(uint64_t)':
fixed_allocator.h:17:5: error: class 'FixedAllocator<Tp>' does not have any field named 'page_size_'
     page_size_(page_size), page_allocator_(page_size * sizeof(Tp)) {}
     ^~~~~~~~~~
fixed_allocator.h: In member function 'Tp* FixedAllocator<Tp>::Allocate()':
fixed_allocator.h:23:36: error: expected ';' before 'i'
             for (unsigned uint64_t i = 0; i < page_size_; i++) {
                                    ^
fixed_allocator.h:23:36: error: 'i' was not declared in this scope
fixed_allocator.h:23:47: error: 'page_size_' was not declared in this scope
             for (unsigned uint64_t i = 0; i < page_size_; i++) {
                                               ^~~~~~~~~~
fixed_allocator.h:23:47: note: suggested alternative: '__size_t'
             for (unsigned uint64_t i = 0; i < page_size_; i++) {
                                               ^~~~~~~~~~
                                               __size_t
fixed_allocator.h:23:57: error: expected ')' before ';' token
             for (unsigned uint64_t i = 0; i < page_size_; i++) {
                                                         ^
fixed_allocator.h:23:13: error: this 'for' clause does not guard... [-Werror=misleading-indentation]
             for (unsigned uint64_t i = 0; i < page_size_; i++) {
             ^~~
fixed_allocator.h:23:59: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
             for (unsigned uint64_t i = 0; i < page_size_; i++) {
                                                           ^
fixed_allocator.h:23:59: error: 'i' was not declared in this scope
fixed_allocator.h: In instantiation of 'Tp* FixedAllocator<Tp>::Allocate() [with Tp = int]':
main.cpp:45:30:   required from here
fixed_allocator.h:21:17: error: unused variable 'f_memory' [-Werror=unused-variable]
             Tp* f_memory = reinterpret_cast<Tp*>(page_allocator_.Allocate());
                 ^~~~~~~~
fixed_allocator.h:28:33: error: request for member 'top' in 'f_memory', which is of non-class type 'int*'
         Tp* f_memory = f_memory.top();
                        ~~~~~~~~~^~~
fixed_allocator.h:29:18: error: request for member 'pop' in 'f_memory', which is of non-class type 'int*'
         f_memory.pop();
         ~~~~~~~~~^~~
fixed_allocator.h: In instantiation of 'Tp* FixedAllocator<Tp>::Allocate() [with Tp = std::__cxx11::basic_string<char>]':
main.cpp:57:24:   required from here
fixed_allocator.h:21:17: error: unused variable 'f_memory' [-Werror=unused-variable]
             Tp* f_memory = reinterpret_cast<Tp*>(page_allocator_.Allocate());
                 ^~~~~~~~
fixed_allocator.h:28:33: error: request for member 'top' in 'f_memory', which is of pointer type 'std::__cxx11::basic_string<char>*' (maybe you meant to use '->' ?)
         Tp* f_memory = f_memory.top();
                        ~~~~~~~~~^~~
fixed_allocator.h:29:18: error: request for member 'pop' in 'f_memory', which is of pointer type 'std::__cxx11::basic_string<char>*' (maybe you meant to use '->' ?)
         f_memory.pop();
         ~~~~~~~~~^~~
fixed_allocator.h: In instantiation of 'Tp* FixedAllocator<Tp>::Allocate() [with Tp = char]':
main.cpp:119:40:   required from here
fixed_allocator.h:21:17: error: unused variable 'f_memory' [-Werror=unused-variable]
             Tp* f_memory = reinterpret_cast<Tp*>(page_allocator_.Allocate());
                 ^~~~~~~~
fixed_allocator.h:28:33: error: request for member 'top' in 'f_memory', which is of non-class type 'char*'
         Tp* f_memory = f_memory.top();
                        ~~~~~~~~~^~~
fixed_allocator.h:29:18: error: request for member 'pop' in 'f_memory', which is of non-class type 'char*'
         f_memory.pop();
         ~~~~~~~~~^~~
cc1plus: all warnings being treated as errors
0.048s 0.009s 9