Opened 3 years ago

Closed 3 years ago

#582 closed ожидаются исправления (задача сдана)

WW #11

Reported by: yurko.andrej Owned by: Святослав Власов
Component: WW_vector Version: 2.0
Keywords: Cc:

Description


Change History (4)

comment:1 Changed 3 years ago by Святослав Власов

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

Не компилируется.

  1. Твои файлы не инклюдят заголовочники от которых зависят (<iostream> в данном случае)
  2. Не хватает константного оператора []
  3. Нет метода clear

Пришлось чинить руками :-/

Тесты:

  1. Конструктор от числа должен инициализировать вектор дефолтными значениями класса T, а не только выделять память. Читай внимательнее условие задания!
  2. resize при изменении размера в большую сторону должен заполнять хвост вектора пустыми элементами, а при изменении в меньшую -- разрушать объекты. У тебя он не делает ни то ни другое.
  3. Вектор не дает никаких гарантий исключений.

7/10 пока что

comment:2 Changed 3 years ago by yurko.andrej

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

comment:3 Changed 3 years ago by Святослав Власов

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

Опять ничего не собралось.
В следующий раз за несобирающиеся посылки буду ставить просто 0.

Во-первых, у тебя пачка ошибок вот такого типа:

include/my_vector_impl.h:50:18: error: catching polymorphic type ‘class std::exception’ by value [-Werror=catch-value=]
   50 |      catch (std::exception) {

И вот такие:

In file included from include/my_vector.h:47,
                 from src/main.cpp:3:
include/my_vector_impl.h: In instantiation of ‘T containers::my_vector<T>::operator[](std::size_t) const [with T = int; std::size_t = long unsigned int]’:
src/main.cpp:315:25:   required from ‘void test_index_operator() [with T = int]’
src/main.cpp:863:34:   required from here
include/my_vector_impl.h:173:10: error: invalid type argument of unary ‘*’ (have ‘int’)
  173 |  T ans = *array_[index];
      |          ^~~~~~~~
include/my_vector_impl.h: In instantiation of ‘T containers::my_vector<T>::operator[](std::size_t) const [with T = Product; std::size_t = long unsigned int]’:
src/main.cpp:315:25:   required from ‘void test_index_operator() [with T = Product]’
src/main.cpp:864:38:   required from here
include/my_vector_impl.h:173:10: error: no match for ‘operator*’ (operand type is ‘Product’)
include/my_vector_impl.h: In instantiation of ‘T containers::my_vector<T>::operator[](std::size_t) const [with T = MinimalClass; std::size_t = long unsigned int]’:
src/main.cpp:315:25:   required from ‘void test_index_operator() [with T = MinimalClass]’
src/main.cpp:865:43:   required from here
include/my_vector_impl.h:173:10: error: no match for ‘operator*’ (operand type is ‘MinimalClass’)

Давай ты доведешь посылку до собирающегося состояния, и тогда я у тебя её проверю.

comment:4 Changed 3 years ago by Святослав Власов

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

Забыл обновить тикет.

И опять не собралось D:

In file included from include/my_vector.h:47,
                 from src/main.cpp:3:
include/my_vector_impl.h: In instantiation of ‘T containers::my_vector<T>::operator[](std::size_t) const [with T = int; std::size_t = long unsigned int]’:
src/main.cpp:315:25:   required from ‘void test_index_operator() [with T = int]’
src/main.cpp:863:34:   required from here
include/my_vector_impl.h:173:10: error: invalid type argument of unary ‘*’ (have ‘int’)
  173 |  T ans = *array_[index];
      |          ^~~~~~~~
include/my_vector_impl.h: In instantiation of ‘T containers::my_vector<T>::operator[](std::size_t) const [with T = Product; std::size_t = long unsigned int]’:
src/main.cpp:315:25:   required from ‘void test_index_operator() [with T = Product]’
src/main.cpp:864:38:   required from here
include/my_vector_impl.h:173:10: error: no match for ‘operator*’ (operand type is ‘Product’)
include/my_vector_impl.h: In instantiation of ‘T containers::my_vector<T>::operator[](std::size_t) const [with T = MinimalClass; std::size_t = long unsigned int]’:
src/main.cpp:315:25:   required from ‘void test_index_operator() [with T = MinimalClass]’
src/main.cpp:865:43:   required from here
include/my_vector_impl.h:173:10: error: no match for ‘operator*’ (operand type is ‘MinimalClass’)
make: *** [makefile:17: obj/main.o] Error 1

Падают тесты на инициализацию, на ресайз и валгринд детектит чет нехорошие на clear. Гарантий исключений снова нет :(
7/10 остается

Note: See TracTickets for help on using tickets.