fix guard

This commit is contained in:
RickyRister 2026-07-26 15:15:34 -07:00
parent e0eb3278c9
commit 07f275a381
2 changed files with 2 additions and 2 deletions

View file

@ -4,8 +4,7 @@
TallyType Tally::intToType(int value) TallyType Tally::intToType(int value)
{ {
// remember to change this whenever you add a new member if (value < static_cast<int>(TallyType::None) || value > static_cast<int>(TallyType::MaxValue)) {
if (value < static_cast<int>(TallyType::None) || value >= static_cast<int>(TallyType::Subtypes)) {
return TallyType::None; return TallyType::None;
} }

View file

@ -20,6 +20,7 @@ enum class TallyType
{ {
None, None,
Subtypes, Subtypes,
MaxValue = Subtypes // sentinel value
}; };
namespace Tally namespace Tally