Mercurial > ~dholland > hg > ag > index.cgi
comparison 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 |
comparison
equal
deleted
inserted
replaced
5:7661c1604e49 | 6:607e3be6bad8 |
---|---|
65 else file = fopen(name = path, "wt"); | 65 else file = fopen(name = path, "wt"); |
66 if (file == NULL) file = stdout; | 66 if (file == NULL) file = stdout; |
67 error_flag = copy_flag = 0; | 67 error_flag = copy_flag = 0; |
68 } | 68 } |
69 | 69 |
70 output_file(output_file &f) : character_sink() { | 70 void operator = (const output_file &f) { |
71 file = f.file; | |
72 name = f.name; | |
73 error_flag = f.error_flag; | |
74 copy_flag = f.copy_flag; | |
75 } | |
76 | |
77 output_file(const output_file &f) : character_sink() { | |
71 *this = f; | 78 *this = f; |
72 copy_flag++; | 79 copy_flag++; |
73 } | 80 } |
74 | 81 |
75 | 82 |
121 | 128 |
122 // Constructor | 129 // Constructor |
123 | 130 |
124 string_accumulator(int nc, int nx = 1); | 131 string_accumulator(int nc, int nx = 1); |
125 string_accumulator(const string_accumulator &); | 132 string_accumulator(const string_accumulator &); |
133 void operator = (const string_accumulator &); | |
126 | 134 |
127 | 135 |
128 // Destructor | 136 // Destructor |
129 | 137 |
130 ~string_accumulator(); | 138 ~string_accumulator(); |