15 lines
346 B
C++

#include <iostream>
#include "Stack.h"
int main() {
Stack<int> s1,s2;
Stack<float> s3;
s2.push(2);
s2.push(3);
s2.push(4);
s1 = s2; // OK
std::cout << s1.pop() << " " << s1.pop() << std::endl;
//s3 = s2; // ERROR without member templates
//std::cout << s3.pop() << " " << s3.pop() << std::endl;
return 0;
}