From 25af0e29a7f8da7e6b54cd25a375c9c581f3b381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=91=D0=BE=D0=B3=D0=B4=D0=B0?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2?= Date: Sun, 21 Nov 2021 10:48:20 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D1=87=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D0=BE=20Storage.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- homework1/Part2/Storage.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/homework1/Part2/Storage.h b/homework1/Part2/Storage.h index a71b581..0901b80 100644 --- a/homework1/Part2/Storage.h +++ b/homework1/Part2/Storage.h @@ -33,6 +33,9 @@ struct Date { } Date operator +(const Date& to_summ) { + + //!!! Неверная перегрузка: почему изменяется первый операнд? Для этого есть += + day += to_summ.day; while (day >= 30) { day = day - 30; @@ -48,6 +51,9 @@ struct Date { } Date operator +(const int& to_summ) { + + //!!! Неверная перегрузка: почему изменяется первый операнд? Для этого есть += + day += to_summ; while (day >= 30) { day = day - 30; @@ -81,6 +87,8 @@ struct Production { int amount_of_products; double unit_price; + //!!! Среди полей есть массив. Где конструктор копирования и оператор присваивания? + bool operator ==(const Production& prod_to_comp) { return storage_id == prod_to_comp.storage_id && product_code == prod_to_comp.product_code && -- GitLab