#ifndef PATRON_H #define PATRON_H template void insertiontri(T1* objet1, T1** tab, int poscourante){ for(;poscourante>0;poscourante--){ if(*objet1 < *tab[poscourante-1]) tab[poscourante] = tab[poscourante-1]; else break; } tab[poscourante] = objet1; } template inline void echange(T1 &objet1, T1 &objet2){ T1 a = objet1; objet1 = objet2; objet2 = a; } template B carre(B const&b){ return b*b; } template inline T1 max(T1 const&a, T1 const&b){return (a>b)?a:b;} template inline T1 min(T1 const&a, T1 const&b){return (a class dynamictab{ private: int nmax; int n; T *ptr; public: dynamictab(){n=0;nmax=0;ptr=NULL;} dynamictab(int nombre_max){nmax = nombre_max; n=0; ptr=new T[nombre_max];} ~dynamictab(){delete[] ptr;} dynamictab(dynamictab const&i){nmax = i.nmax; n=i.n; ptr=new T[nmax]; int k;for(k=0;k const&i){nmax = i.nmax; n=i.n; delete ptr;ptr=new T[nmax]; int k;for(k=0;k=n){printf("ecriture du type %ld, n :%d, i: %d ",sizeof(T),n,i);exit(96);} return ptr[i];} inline T const& operator()(int i)const{ //if(i>=n){printf("lecture du type %ld, n :%d, i: %d ",sizeof(T),n,i);exit(96);} return ptr[i];} inline T& last(){return ptr[n-1];} inline T const& last()const{return ptr[n-1];} inline T& first(){return ptr[0];} inline T const& first()const{return ptr[0];} inline int end()const{return n;} inline int endalloc()const{return nmax;} inline bool isempty()const{return n==0;} //* void seek_suppr(const T& a_supprimer){ T* p; for(p=ptr;p Indicestab; #endif