Vote count:
0
Header:
using PureCommand = QVector<qint8>;
using PureAnswer = QVector<qint8>;
using CommandName = QString;
using AnswerName = QString;
PureCommand nameToPure(CommandName commandName);
PureAnswer nameToPure(AnswerName answerName);
Cpp:
PureCommand Hasher::nameToPure(CommandName answerName) {
return this->commandHash.find(commandName).value();
}
PureAnswer Hasher::nameToPure(AnswerName answerName) {
return this->answerHash.find(answerName).value();
}
These give me build errors:
error: Hasher::nameToPure(AnswerName)' cannot be overloaded
error: with 'PureCommand Hasher::nameToPure(CommandName)'
These are just some simple functions but I have a lot of more complicated of a kind... I guess it's because e.g. PureCommand and PureAnswer are basically the same type but I've found this approach elegant and easy to work with. If it can't be done, I'll just lengthen the function names to make e.g. commandNameToPure(CommandName commandName) and answerNameToPure(AnswerName answerName) but I was just wondering what's really wrong here.
asked 1 min ago
Aucun commentaire:
Enregistrer un commentaire