ID 5787909
Пользователь Новожилов Илья Сергеевич
Время 22:57<< 16.11.2021 22:58 (27 д. 20:58) 22:58>>
Обработка 22:58 ... 22:58 (3,39 сек.)
Файл 5787909.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: In instantiation of 'Tp* FixedAllocator<Tp>::Allocate() [with Tp = int]':
main.cpp:45:30:   required from here
fixed_allocator.h:15:24: error: cannot dynamic_cast '((FixedAllocator<int>*)this)->FixedAllocator<int>::page_allocator_->PageAllocator::Allocate()' (of type 'void*') to type 'int*' (target is not pointer or reference to class)
             Tp* next = dynamic_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:15:24: error: cannot dynamic_cast '((FixedAllocator<std::__cxx11::basic_string<char> >*)this)->FixedAllocator<std::__cxx11::basic_string<char> >::page_allocator_->PageAllocator::Allocate()' (of type 'void*') to type 'class std::__cxx11::basic_string<char>*' (source is not a pointer to class)
fixed_allocator.h: In instantiation of 'Tp* FixedAllocator<Tp>::Allocate() [with Tp = char]':
main.cpp:119:40:   required from here
fixed_allocator.h:15:24: error: cannot dynamic_cast '((FixedAllocator<char>*)this)->FixedAllocator<char>::page_allocator_->PageAllocator::Allocate()' (of type 'void*') to type 'char*' (target is not pointer or reference to class)
0.035s 0.009s 9