AP_Common: Add % operator to TSIndex

This commit is contained in:
Michael du Breuil 2020-06-11 17:35:09 -07:00 committed by Andrew Tridgell
parent b3a2b360e6
commit ab2dea5b86

View File

@ -49,6 +49,11 @@ public:
return typesafe_index(p++); return typesafe_index(p++);
} }
typesafe_index operator%(const base_type& val)
{
return typesafe_index(p % val);
}
bool operator<(const base_type& val) const bool operator<(const base_type& val) const
{ {
return (p<val); return (p<val);
@ -110,4 +115,4 @@ public:
{ {
return _priv_instance[index.get_int()]; return _priv_instance[index.get_int()];
} }
}; };