comparison anagram/agcore/rule.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
42 } 42 }
43 43
44 Rule::Rule() : ObjectRegister<RuleDescriptor>() {} 44 Rule::Rule() : ObjectRegister<RuleDescriptor>() {}
45 Rule::Rule(int x) : ObjectRegister<RuleDescriptor>(x) {} 45 Rule::Rule(int x) : ObjectRegister<RuleDescriptor>(x) {}
46 Rule::Rule(const Rule &t) : ObjectRegister<RuleDescriptor>(t) {} 46 Rule::Rule(const Rule &t) : ObjectRegister<RuleDescriptor>(t) {}
47 void Rule::operator = (const Rule &t) {
48 ObjectRegister<RuleDescriptor>::operator = (t);
49 }
47 50
48 51
49 RuleDescriptor &Rule::Map::operator [] (unsigned x) { 52 RuleDescriptor &Rule::Map::operator [] (unsigned x) {
50 //LOGSECTION("RuleDescriptor::operator[]"); 53 //LOGSECTION("RuleDescriptor::operator[]");
51 //LOGV(x) LCV(Rule::descriptorList.size()); 54 //LOGV(x) LCV(Rule::descriptorList.size());
214 } 217 }
215 218
216 int VpRuleDescriptor::operator < (const VpRuleDescriptor x) const { 219 int VpRuleDescriptor::operator < (const VpRuleDescriptor x) const {
217 if (elementList < x.elementList) return 1; 220 if (elementList < x.elementList) return 1;
218 if (x.elementList < elementList) return 0; 221 if (x.elementList < elementList) return 0;
219 return procedureName < procedureName; 222 return procedureName < x.procedureName;
220 } 223 }
221 224
222 VpRule::VpRule() : KeyedObjectRegister<VpRuleDescriptor>() {} 225 VpRule::VpRule() : KeyedObjectRegister<VpRuleDescriptor>() {}
223 VpRule::VpRule(const int x) : KeyedObjectRegister<VpRuleDescriptor>(x) {} 226 VpRule::VpRule(const int x) : KeyedObjectRegister<VpRuleDescriptor>(x) {}
224 VpRule::VpRule(const VpRule &x) : KeyedObjectRegister<VpRuleDescriptor>(x) {} 227 VpRule::VpRule(const VpRule &x) : KeyedObjectRegister<VpRuleDescriptor>(x) {}