mirror of
https://github.com/dborth/fceugx.git
synced 2024-11-01 15:05:05 +01:00
22 lines
423 B
C
22 lines
423 B
C
|
#ifndef _VALUEARRAY_H_
|
||
|
#define _VALUEARRAY_H_
|
||
|
|
||
|
template<typename T, int N>
|
||
|
struct ValueArray
|
||
|
{
|
||
|
T data[N];
|
||
|
T &operator[](int index) { return data[index]; }
|
||
|
static const int size = N;
|
||
|
bool operator!=(ValueArray<T,N> &other) { return !operator==(other); }
|
||
|
bool operator==(ValueArray<T,N> &other)
|
||
|
{
|
||
|
for(int i=0;i<size;i++)
|
||
|
if(data[i] != other[i])
|
||
|
return false;
|
||
|
return true;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
#endif
|
||
|
|