Мой код: < /p>
#ifndef SORTEDTYPE_H_INCLUDED
#define SORTEDTYPE_H_INCLUDED
const int MAX_ITEMS = 5;
template
class SortedType
{
public :
SortedType();
void MakeEmpty();
bool IsFull();
int LengthIs();
void InsertItem(T);
void DeleteItem(T);
void RetrieveItem(T&, bool&);
void ResetList();
void GetNextItem(T&);
private:
int length;
T info[MAX_ITEMS];
int currentPos;
};
#endif // SORTEDTYPE_H_INCLUDED
#include "sortedtype.h"
template
SortedType::SortedType()
{
length = 0;
currentPos = - 1;
}
template
void SortedType::MakeEmpty()
{
length = 0;
}
template
bool SortedType::IsFull()
{
return (length == MAX_ITEMS);
}
template
int SortedType::LengthIs()
{
return length;
}
template
void SortedType::InsertItem(T item)
{
int location = 0;
for(int i= 0; i
Подробнее здесь: https://stackoverflow.com/questions/632 ... n-i-fix-it