diff options
Diffstat (limited to 'lib/bufferarray.cc')
-rw-r--r-- | lib/bufferarray.cc | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/bufferarray.cc b/lib/bufferarray.cc index 77a08c6..953ec8f 100644 --- a/lib/bufferarray.cc +++ b/lib/bufferarray.cc @@ -125,16 +125,25 @@ operator [](const unsigned long index) return buff[index]; } -bufferArray &bufferArray:: -operator +(const bufferStore &a) +bufferArray bufferArray:: +operator +(const bufferStore &s) { - append(a); - return *this; + bufferArray res = *this; + res += s; + return res; } -bufferArray &bufferArray:: +bufferArray bufferArray:: operator +(const bufferArray &a) { + bufferArray res = *this; + res += a; + return res; +} + +bufferArray &bufferArray:: +operator +=(const bufferArray &a) +{ lenAllocd += a.lenAllocd; bufferStore *nb = new bufferStore[lenAllocd]; for (int i = 0; i < len; i++) @@ -148,8 +157,8 @@ operator +(const bufferArray &a) } bufferArray &bufferArray:: -operator +=(const bufferStore &a) +operator +=(const bufferStore &s) { - append(a); + append(s); return *this; } |