From a08bab503eb7725352938e0fd0c5234eb47848d0 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: Mon, 29 Nov 2021 10:27:51 +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=20SportsComplex.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Streams and STL/Streams and STL/SportsComplex.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Streams and STL/Streams and STL/SportsComplex.h b/Streams and STL/Streams and STL/SportsComplex.h index 4229865..d6b8a31 100644 --- a/Streams and STL/Streams and STL/SportsComplex.h +++ b/Streams and STL/Streams and STL/SportsComplex.h @@ -140,6 +140,9 @@ private: Info& operator = (const Info& other_info) { + //!!! Проверка на самоприсваивание + //!!! Для работы со строками есть готовые функции. + for (int i = 0; i < 64; ++i) { if (i < strlen(other_info.client_surname)) @@ -229,7 +232,7 @@ private: return info.minutes < other_info.minutes; } - bool is_inside(const std::multiset container) + bool is_inside(const std::multiset container) //!!! Передача по значению { for (auto i = container.begin(); i != container.end(); ++i) { @@ -245,6 +248,8 @@ private: std::multiset container; public: SportsComplex(): container(std::multiset()) {} + + //!!! Передача по значению SportsComplex(std::multiset container_) : container(container_) {} bool operator == (const SportsComplex&); -- GitLab