Mercurial > ~dholland > hg > ag > index.cgi
diff oldclasslib/include/charsink.h @ 6:607e3be6bad8
Adjust to the moving target called the C++ standard.
Apparently nowadays it's not allowed to define an explicit copy
constructor but not an assignment operator. Consequently, defining the
explicit copy constructor in terms of the implicit/automatic
assignment operator for general convenience no longer works.
Add assignment operators.
Caution: not tested with the IBM compiler, but there's no particular
reason it shouldn't work.
author | David A. Holland |
---|---|
date | Mon, 30 May 2022 23:46:22 -0400 |
parents | 13d2b8934445 |
children |
line wrap: on
line diff
--- a/oldclasslib/include/charsink.h Mon May 30 23:32:56 2022 -0400 +++ b/oldclasslib/include/charsink.h Mon May 30 23:46:22 2022 -0400 @@ -67,7 +67,14 @@ error_flag = copy_flag = 0; } - output_file(output_file &f) : character_sink() { + void operator = (const output_file &f) { + file = f.file; + name = f.name; + error_flag = f.error_flag; + copy_flag = f.copy_flag; + } + + output_file(const output_file &f) : character_sink() { *this = f; copy_flag++; } @@ -123,6 +130,7 @@ string_accumulator(int nc, int nx = 1); string_accumulator(const string_accumulator &); + void operator = (const string_accumulator &); // Destructor