comparison anagram/agcore/token.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
54 LOGSECTION("token_number_map::token_number_map"); 54 LOGSECTION("token_number_map::token_number_map");
55 } 55 }
56 56
57 Token::Token(int x) : ObjectRegister<token_number_map>(x) {} 57 Token::Token(int x) : ObjectRegister<token_number_map>(x) {}
58 Token::Token(const Token &t) : ObjectRegister<token_number_map>(t) {} 58 Token::Token(const Token &t) : ObjectRegister<token_number_map>(t) {}
59 59 void Token::operator = (const Token &t) {
60 ObjectRegister<token_number_map>::operator = (t);
61 }
60 62
61 Token Token::create() { 63 Token Token::create() {
62 LOGSECTION("Token::create"); 64 LOGSECTION("Token::create");
63 ntkns = descriptorList.size(); 65 ntkns = descriptorList.size();
64 descriptorList.push(token_number_map()); 66 descriptorList.push(token_number_map());