ID 5731531
Пользователь Борцов Роман Александрович
Время 16:25<< 11.11.2021 16:27 (22 д. 14:27) 16:29>>
Обработка 16:27 ... 16:27 (2,05 сек.)
Файл 5731531.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 'FixedAllocator<Tp>::FixedAllocator(uint64_t) [with Tp = int; uint64_t = long unsigned int]':
main.cpp:44:32:   required from here
fixed_allocator.h:7:75: error: no matching function for call to 'PageAllocator::PageAllocator()'
     explicit FixedAllocator(std::uint64_t page_size) : page_size(page_size) {}
                                                                           ^
main.cpp:9:5: note: candidate: PageAllocator::PageAllocator(uint64_t)
     PageAllocator(std::uint64_t page_size) : page_size_(page_size) {
     ^~~~~~~~~~~~~
main.cpp:9:5: note:   candidate expects 1 argument, 0 provided
main.cpp:4:7: note: candidate: PageAllocator::PageAllocator(const PageAllocator&)
 class PageAllocator {
       ^~~~~~~~~~~~~
main.cpp:4:7: note:   candidate expects 1 argument, 0 provided
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:11:15: error: cannot convert 'char*' to 'int*' in assignment
             p = new char[sizeof(Tp) * page_size];
             ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fixed_allocator.h: In instantiation of 'FixedAllocator<Tp>::FixedAllocator(uint64_t) [with Tp = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]':
main.cpp:55:41:   required from here
fixed_allocator.h:7:75: error: no matching function for call to 'PageAllocator::PageAllocator()'
     explicit FixedAllocator(std::uint64_t page_size) : page_size(page_size) {}
                                                                           ^
main.cpp:9:5: note: candidate: PageAllocator::PageAllocator(uint64_t)
     PageAllocator(std::uint64_t page_size) : page_size_(page_size) {
     ^~~~~~~~~~~~~
main.cpp:9:5: note:   candidate expects 1 argument, 0 provided
main.cpp:4:7: note: candidate: PageAllocator::PageAllocator(const PageAllocator&)
 class PageAllocator {
       ^~~~~~~~~~~~~
main.cpp:4:7: note:   candidate expects 1 argument, 0 provided
In file included from main.cpp:28:0:
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:11:15: error: cannot convert 'char*' to 'std::__cxx11::basic_string<char>*' in assignment
             p = new char[sizeof(Tp) * page_size];
             ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fixed_allocator.h: In instantiation of 'FixedAllocator<Tp>::FixedAllocator(uint64_t) [with Tp = char; uint64_t = long unsigned int]':
main.cpp:116:35:   required from here
fixed_allocator.h:7:75: error: no matching function for call to 'PageAllocator::PageAllocator()'
     explicit FixedAllocator(std::uint64_t page_size) : page_size(page_size) {}
                                                                           ^
main.cpp:9:5: note: candidate: PageAllocator::PageAllocator(uint64_t)
     PageAllocator(std::uint64_t page_size) : page_size_(page_size) {
     ^~~~~~~~~~~~~
main.cpp:9:5: note:   candidate expects 1 argument, 0 provided
main.cpp:4:7: note: candidate: PageAllocator::PageAllocator(const PageAllocator&)
 class PageAllocator {
       ^~~~~~~~~~~~~
main.cpp:4:7: note:   candidate expects 1 argument, 0 provided
0.128s 0.008s 9