Цитата(forever failure @ Apr 28 2007, 17:46)

Дык проблема есть или исчерпана ?
Проблема есть.
Теперь по порядку:
IDE/компилятор: Keil 166 EC++.
Проц Infineon XC167.
List.h...Код
template <class T>
class TList {
struct _SList {
T * item;
struct _SList * next;
struct _SList * prev;
};
typedef struct _SList SList;
public:
SList * base;
SList * NewItem;
TList(void) {base = NULL; NewItem = NULL;};
void AddItem(T * PRec);
U16 CountItems(void);
};
List.cpp...Код
#include <stdio.h> /* standard I/O .h-file */
#include <stdlib.h>
#include <intrins.h>
#include <absacc.h> // Absolute Memory Access
#include "main.h"
#include "gl.h"
#include "ec_error.h"
#include "Graph.h"
#include "List.h"
//------------------------------------------------------------------------------
template <class T>
void TList<T>::AddItem(T * PRec)
{
SList * Current;
if(base != NULL)
{
Current = base;
while(Current->next != NULL)
Current = Current->next;
NewItem = new SList;
Current->next = NewItem;
NewItem->next = NULL;
NewItem->prev = Current;
NewItem->item = PRec;
}
else
{
base = new SList;
base->next = NULL;
base->prev = NULL;
base->item = PRec;
}
}
//------------------------------------------------------------------------------
template <class T>
U16 TList<T>::CountItems(void)
{
U16 i = 0;
SList * Current;
if(base != NULL)
{
Current = base;
while(Current->next != NULL)
{
Current = Current->next;
i++;
}
}
return i;
}
//------------------------------------------------------------------------------
Test.cpp...Код
void Test(void)
{
U16 cnt;
TList<U16> A;
cnt = A.CountItems(); // Без этой строчки никаких ошибок вообще нет!
}
P.S. Если ф-ции члены класса делать inline внутри класса - ошибок тоже нет
Вот, если не затруднит гляньте плз