Mercurial > ~dholland > hg > ag > index.cgi
comparison oldclasslib/source/strdict.cpp @ 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 |
---|---|
44 ns = 1; // can't use zero | 44 ns = 1; // can't use zero |
45 n_calls = n_collisions = 0; // clear statistics | 45 n_calls = n_collisions = 0; // clear statistics |
46 copy_flag = 0; // live | 46 copy_flag = 0; // live |
47 } | 47 } |
48 | 48 |
49 string_dictionary::string_dictionary(string_dictionary &s) { | 49 void string_dictionary::operator = (const string_dictionary &s) { |
50 sxs = s.sxs; | |
51 cs = s.cs; | |
52 csx = s.csx; | |
53 csxmax = s.csxmax; | |
54 ns = s.ns; | |
55 nsmax = s.nsmax; | |
56 ht = s.ht; | |
57 htl = s.htl; | |
58 htmask = s.htmask; | |
59 n_calls = s.n_calls; | |
60 n_collisions = s.n_collisions; | |
61 copy_flag = s.copy_flag; | |
62 } | |
63 | |
64 string_dictionary::string_dictionary(const string_dictionary &s) { | |
50 *this = s; | 65 *this = s; |
51 copy_flag++; //memorex | 66 copy_flag++; //memorex |
52 } | 67 } |
53 | 68 |
54 | 69 |