GCC fixes.
SVN r677 (trunk)
This commit is contained in:
parent
016ac67376
commit
bec0d3438f
9 changed files with 30 additions and 22 deletions
14
src/tarray.h
14
src/tarray.h
|
|
@ -43,7 +43,9 @@
|
|||
|
||||
// TArray -------------------------------------------------------------------
|
||||
|
||||
template <class T>
|
||||
// T is the type stored in the array.
|
||||
// TT is the type returned by operator().
|
||||
template <class T, class TT=T>
|
||||
class TArray
|
||||
{
|
||||
public:
|
||||
|
|
@ -107,10 +109,16 @@ public:
|
|||
Most = 0;
|
||||
}
|
||||
}
|
||||
// Return a reference to an element
|
||||
T &operator[] (unsigned int index) const
|
||||
{
|
||||
return Array[index];
|
||||
}
|
||||
// Returns the value of an element
|
||||
TT operator() (unsigned int index) const
|
||||
{
|
||||
return Array[index];
|
||||
}
|
||||
unsigned int Push (const T &item)
|
||||
{
|
||||
Grow (1);
|
||||
|
|
@ -283,8 +291,8 @@ private:
|
|||
// It can still be used as a normal TArray if needed. ACS uses this for
|
||||
// world and global arrays.
|
||||
|
||||
template <class T>
|
||||
class TAutoGrowArray : public TArray<T>
|
||||
template <class T, class TT=T>
|
||||
class TAutoGrowArray : public TArray<T, TT>
|
||||
{
|
||||
public:
|
||||
T GetVal (unsigned int index)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue