|
@@ -56,10 +56,14 @@ public:
|
|
|
void Clear();
|
|
void Clear();
|
|
|
|
|
|
|
|
int Find(const T& element) const;
|
|
int Find(const T& element) const;
|
|
|
- const T& GetElement(int index) const;
|
|
|
|
|
|
|
|
|
|
const Array<T, size>& operator=(const Array<T, size>& b);
|
|
const Array<T, size>& operator=(const Array<T, size>& b);
|
|
|
|
|
|
|
|
|
|
+ T* GetBegin();
|
|
|
|
|
+ const T* GetBegin() const;
|
|
|
|
|
+ T* GetEnd();
|
|
|
|
|
+ const T* GetEnd() const;
|
|
|
|
|
+
|
|
|
private:
|
|
private:
|
|
|
|
|
|
|
|
int mCount; // The number of elements
|
|
int mCount; // The number of elements
|
|
@@ -273,24 +277,6 @@ inline int Array<T, size>::Find(const T& element) const
|
|
|
return -1;
|
|
return -1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/**
|
|
|
|
|
- Random access.
|
|
|
|
|
-@note
|
|
|
|
|
- The index has to be smaller than GetSize()
|
|
|
|
|
-@param index
|
|
|
|
|
- The index
|
|
|
|
|
-@return
|
|
|
|
|
- The element at the given index
|
|
|
|
|
-*/
|
|
|
|
|
-template <typename T, int size>
|
|
|
|
|
-inline const T& Array<T, size>::GetElement(int index) const
|
|
|
|
|
-{
|
|
|
|
|
- assert(index >= 0);
|
|
|
|
|
- assert(index < mCount);
|
|
|
|
|
-
|
|
|
|
|
- return mArray[index];
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
Copies the content of the other list into this.
|
|
Copies the content of the other list into this.
|
|
|
@return
|
|
@return
|
|
@@ -309,3 +295,31 @@ inline const Array<T, size>& Array<T, size>::operator=(const Array<T, size>& b)
|
|
|
return *this;
|
|
return *this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
|
|
+template <typename T, int size>
|
|
|
|
|
+inline const T* Array<T, size>::GetBegin() const
|
|
|
|
|
+{
|
|
|
|
|
+ return mArray;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
|
|
+template <typename T, int size>
|
|
|
|
|
+inline T* Array<T, size>::GetBegin()
|
|
|
|
|
+{
|
|
|
|
|
+ return mArray;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
|
|
+template <typename T, int size>
|
|
|
|
|
+inline const T* Array<T, size>::GetEnd() const
|
|
|
|
|
+{
|
|
|
|
|
+ return mArray + (mCount - 1);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//-----------------------------------------------------------------------------
|
|
|
|
|
+template <typename T, int size>
|
|
|
|
|
+inline T* Array<T, size>::GetEnd()
|
|
|
|
|
+{
|
|
|
|
|
+ return mArray + (mCount - 1);
|
|
|
|
|
+}
|
|
|
|
|
+
|