mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-27 08:29:11 +00:00
Codechange: Allow iterating a BaseBitSet.
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
#ifndef BASE_BITSET_TYPE_HPP
|
||||
#define BASE_BITSET_TYPE_HPP
|
||||
|
||||
#include "bitmath_func.hpp"
|
||||
|
||||
/**
|
||||
* Base for bit set wrapper.
|
||||
* Allows wrapping strong type values as a bit set. Methods are loosely modelled on std::bitset.
|
||||
@@ -206,6 +208,9 @@ public:
|
||||
return (this->base() & Tmask) == this->base();
|
||||
}
|
||||
|
||||
auto begin() const { return SetBitIterator<Tvalue_type>(this->data).begin(); }
|
||||
auto end() const { return SetBitIterator<Tvalue_type>(this->data).end(); }
|
||||
|
||||
private:
|
||||
Tstorage data; ///< Bitmask of values.
|
||||
};
|
||||
|
Reference in New Issue
Block a user