Resize Array Template
<p>i need a template Function to resize an Array of any type.</p>

<p>Here ist my try:</p>

<pre><code>class CCommon
{
template &lt; typename T &gt;
static void ResizeArray(T* paArray, int iOldSize, int iNewSize, T tInitValue);
}

..

template &lt; typename T &gt;
void CCommon::ResizeArray(T* paArray, int iOldSize, int iNewSize, T tInitValue)
{
 T* paTmpArray = new T[iOldSize];
 for(int i = 0; i &lt; iOldSize; i++)
 {
  paTmpArray[i] = paArray[i];
 }
 delete [] paArray;
 paArray=new T[iNewSize];
 for(int i=0; i &lt; iNewSize; i++)
 {
  paArray[i] = tInitValue;
 }
 for(int i = 0; i &lt; iOldSize; i++)
 {
  paArray[i] = paTmpArray[i];
 }
 delete [] paTmpArray;
}
</code></pre>

<p>The CCommon File is even compilable, but if i want to use it i get the Error:</p>

<blockquote>
  <p>Fehler 2 error LNK2019: Verweis auf
  nicht aufgelöstes externes Symbol
  ""public: static void __cdecl
  CCommon::ResizeArray(int
  *,int,int,int)" (??$ResizeArray@H@CCommon@@SAXPAHHHH@Z)"
  in Funktion ""public: void __thiscall
  CWaebi_OBJ::ReInit(void)"
  (?ReInit@CWaebi_OBJ@@QAEXXZ)". CWaebi_OBJ.obj</p>
  
  <p>Fehler 3 fatal error LNK1120: 1 nicht
  aufgelöste externe
  Verweise. c:\PolFlow\Debug\Balance_V1.exe 1</p>
</blockquote>

<p>This is how i want to call it:</p>

<pre><code>#include CCommon

SomeFunction
{
..
CCommon::ResizeArray&lt;BOOL&gt;( mTextIndexMask, m_iNumberOfLastTextMaskArray, mTextCount, FALSE );
..
}
</code></pre>

<p>What is wrong?</p>

<p>regards camelord</p>
