Use T::index_type for highest_valid
This commit is contained in:
parent
012b65a37c
commit
745de17c41
|
@ -2,7 +2,7 @@
|
|||
#include <cstddef>
|
||||
#include <iterator>
|
||||
|
||||
template <typename T, typename I = std::size_t>
|
||||
template <typename T, typename I = typename T::index_type>
|
||||
struct highest_valid_t
|
||||
{
|
||||
struct iterator : std::iterator<std::forward_iterator_tag, I>
|
||||
|
@ -36,7 +36,7 @@ struct highest_valid_t
|
|||
};
|
||||
|
||||
template <typename T>
|
||||
highest_valid_t<T> highest_valid(T &t, std::size_t start = 0)
|
||||
highest_valid_t<T> highest_valid(T &t, typename T::index_type start = 0)
|
||||
{
|
||||
return {t, start};
|
||||
}
|
||||
|
|
|
@ -395,6 +395,7 @@ struct obj_position
|
|||
|
||||
struct object_array_t : array<object, MAX_OBJECTS>
|
||||
{
|
||||
typedef uint16_t index_type;
|
||||
int highest;
|
||||
#define Highest_object_index Objects.highest
|
||||
typedef array<object, MAX_OBJECTS> array_t;
|
||||
|
|
|
@ -186,6 +186,7 @@ struct group
|
|||
|
||||
struct segment_array_t : public array<segment, MAX_SEGMENTS>
|
||||
{
|
||||
typedef uint16_t index_type;
|
||||
unsigned highest;
|
||||
#define Highest_segment_index Segments.highest
|
||||
typedef array<segment, MAX_SEGMENTS> array_t;
|
||||
|
|
Loading…
Reference in a new issue