From 24d72bb57449bf390842505dfa5362663b657bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=83=D1=82=D0=B8=D0=BD=20=D0=94=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D1=8C=D0=B5=D0=B2?= =?UTF-8?q?=D0=B8=D1=87?= Date: Fri, 4 Oct 2019 14:21:51 +0300 Subject: [PATCH] daym --- src/tset.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tset.cpp b/src/tset.cpp index 7f9d2c646..fb92b8d4e 100644 --- a/src/tset.cpp +++ b/src/tset.cpp @@ -96,7 +96,14 @@ TSet TSet::operator+(const TSet &s) // объединение TSet TSet::operator+(const int Elem) // объединение с элементом { - return *this; + if ((Elem > -1) && (Elem < BitField.GetLength())) { + TSet result(MaxPower); + TBitField E(Elem); + E.SetBit(Elem); + result.BitField = BitField | E; + return result; + } + else throw - 1; } TSet TSet::operator-(const int Elem) // разность с элементом