ID 5787218
Пользователь Зеленский Сергей Максимович
Время 20:54<< 16.11.2021 20:55 (27 д. 18:55) 20:55>>
Обработка 20:55 ... 20:55 (2,16 сек.)
Файл 5787218.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:10:14: error: expected ';' at end of member declaration
     unsigned uint64_t page_size_;
              ^~~~~~~~
fixed_allocator.h:10:23: 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:16:46: error: class 'FixedAllocator<Tp>' does not have any field named 'page_size_'
     page_allocator_(page_size * sizeof(Tp)), page_size_(page_size) {}
                                              ^~~~~~~~~~
fixed_allocator.h: In member function 'Tp* FixedAllocator<Tp>::Allocate()':
fixed_allocator.h:22:36: error: expected ';' before 'i'
             for (unsigned uint64_t i = 0; i < page_size_; i++) {
                                    ^
fixed_allocator.h:22:36: error: 'i' was not declared in this scope
fixed_allocator.h:22:47: error: 'page_size_' was not declared in this scope
             for (unsigned uint64_t i = 0; i < page_size_; i++) {
                                               ^~~~~~~~~~
fixed_allocator.h:22:47: note: suggested alternative: '__size_t'
             for (unsigned uint64_t i = 0; i < page_size_; i++) {
                                               ^~~~~~~~~~
                                               __size_t
fixed_allocator.h:22:57: error: expected ')' before ';' token
             for (unsigned uint64_t i = 0; i < page_size_; i++) {
                                                         ^
fixed_allocator.h:22:13: error: this 'for' clause does not guard... [-Werror=misleading-indentation]
             for (unsigned uint64_t i = 0; i < page_size_; i++) {
             ^~~
fixed_allocator.h:22: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:22: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:20:17: error: unused variable 'free_memory' [-Werror=unused-variable]
             Tp* free_memory = reinterpret_cast<Tp*>(page_allocator_.Allocate());
                 ^~~~~~~~~~~
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:20:17: error: unused variable 'free_memory' [-Werror=unused-variable]
fixed_allocator.h: In instantiation of 'Tp* FixedAllocator<Tp>::Allocate() [with Tp = char]':
main.cpp:119:40:   required from here
fixed_allocator.h:20:17: error: unused variable 'free_memory' [-Werror=unused-variable]
cc1plus: all warnings being treated as errors
[печатать | |
]
(987 b)
0.039s 0.009s 10