Opened 3 years ago

Closed 3 years ago

#554 closed ожидается проверка (задача сдана)

WW_vector Martynov lab_11

Reported by: martynov.maksim Owned by: Антон Филатов
Component: WW_vector Version: 2.0
Keywords: Cc:

Description


Change History (3)

comment:1 Changed 3 years ago by Антон Филатов

Type: ожидается проверкаожидаются исправления

Мои кастомные тесты не коспилируются.
Во-первых он ругается на assert

include/my_vector_impl.h: In member function ‘T& containers::my_vector<T>::operator[](std::size_t) const’:
include/my_vector_impl.h:86:9: error: there are no arguments to ‘assert’ that depend on a template parameter, so a declaration of ‘assert’ must be available [-fpermissive]
         assert(index < size_);

Во-вторых на push_back (не надо его от ссылки делать. Либо от константной ссылки, чтобы скопировать внутри psuh_back, либо просто от шаблона, чтобы, он сам копию сделал)

error: cannot bind non-const lvalue reference of type ‘int&’ to an rvalue of type ‘int’
     vec.push_back(get_object<T>(0));

И на вывод ругается

error: no match for ‘operator<<’ (operand types are ‘std::basic_ostream<char>’ and ‘const containers::my_vector<int>’)
         std::cout << "|" << cvec << "|" << std::endl;
         ~~~~~~~~~~~~~~~~~^~~~~~~

Стиль:

  • pop_back и clear - копипаста
  • в reserve тоже простится clear (и в деструктор)

Пока из-за невозможности компилировать, это 2/10

comment:2 Changed 3 years ago by martynov.maksim

Type: ожидаются исправленияожидается проверка
Version: 1.02.0

comment:3 Changed 3 years ago by Антон Филатов

Resolution: задача сдана
Status: assignedclosed

10/10

Note: See TracTickets for help on using tickets.