operand: Use pure virtual functions

This commit is contained in:
ReinUsesLisp 2019-11-01 06:07:53 -03:00
parent 4c2981eab5
commit b4eeadfd9b
8 changed files with 39 additions and 51 deletions

View file

@ -22,16 +22,16 @@ void LiteralNumber::Fetch(Stream& stream) const {
}
}
u16 LiteralNumber::GetWordCount() const {
u16 LiteralNumber::GetWordCount() const noexcept {
return is_32 ? 1 : 2;
}
bool LiteralNumber::operator==(const Operand& other) const {
if (GetType() == other.GetType()) {
const auto& o{static_cast<const LiteralNumber&>(other)};
return o.raw == raw && o.is_32 == is_32;
bool LiteralNumber::operator==(const Operand& other) const noexcept {
if (!EqualType(other)) {
return false;
}
return false;
const auto& o{static_cast<const LiteralNumber&>(other)};
return o.raw == raw && o.is_32 == is_32;
}
} // namespace Sirit