#ifndef STACK_H // Fichier Stack.h #define STACK_H #include using namespace std; template class Stack; template // Pour les fonctions ostream& operator<<(ostream& os, const Stack& s); // friend template. // Il faut aussi <> ! const int MAX = 10; // export // ... En theorie, si on ajoute export, ca evite le template // #include "Stack.cpp" dans le fichier du prg principal class Stack { friend ostream& operator<< <>(ostream& os, const Stack& s); public : Stack(void); Stack(const Stack& s); Stack& operator=(const Stack& s); virtual ~Stack(void); bool empty(void) const; bool full(void) const; int size(void) const; const T& top(void) const; void push(const T& t); T pop(void); private : T _stack[MAX]; int _size; void _copy(const Stack& s); void _destroy(void); }; #endif // STACK_H