Не могу заставить собраться приметивнейшую прогу с использованием шаблонного класса. Может наш лор сможет помочь? Ошибка следующая:
ld: symbol(s) not found for architecture x86_64
stack.h:
#ifndef STACK_H
#define STACK_H
using namespace std;
const int MAX = 100;
template <class Type> class Stack
{
private:
Type st[MAX];
int top;
public:
Stack();
void push(Type var);
Type pop();
};
#endif // STACK_H
stack.cpp
template <class Type> Stack<Type>::Stack()
{
top = -1;
}
template <class Type>void Stack<Type>::push(Type var)
{
st[++top] = var;
}
template <class Type> Type Stack<Type>::pop()
{
return st[top--];
}
void TemporaryFunction ()
{
Stack<int> s;
}
#include "stack.h"
int main(int argc, char *argv[])
{
Stack<float> s1;
return 0;
}