#ifndef WEK_H #define WEK_H #include #include "class.h" template class Wektor{ private: vector wek; public: Wektor(); void back_push(T a); void erase(unsigned int ktora); void print(); T back_pop(); T& operator[](unsigned int pozycja); void sprZakres(); void sprTyp(); class WyZakres{public:WyZakres(){}}; class WyTyp{public:WyTyp(){}}; }; template class Wektor{ private: vector wek; Wektor(){}; public: void back_push(T a); void erase(unsigned int ktora); void print(); T back_pop(); T& operator[](unsigned int pozycja); }; template class Wektor{ private: vector wek; public: Wektor(); void back_push(int a); void erase(unsigned int ktora); void print(); void sort(int poczatek,int koniec); int wielkosc(); void back_pop(); int& operator[](unsigned int pozycja); void sprZakres(); void sprTyp(); class WyZakres{public:WyZakres(){}}; class WyTyp{public:WyTyp(){}}; }; template class Wektor{ private: vector wek; public: Wektor(); void back_push(double a); void erase(unsigned int ktora); void print(); void sort(int poczatek, int koniec); int wielkosc(); void back_pop(); double& operator[](unsigned int pozycja); void sprZakres(); void sprTyp(); class WyZakres{public:WyZakres(){}}; class WyTyp{public:WyTyp(){}}; }; template class Wektor{ private: vector wek; public: Wektor(); void back_push(LiczbaMax a); void erase(unsigned int ktora); void print(); void sort(); void back_pop(); LiczbaMax& operator[](unsigned int pozycja); void sprZakres(); void sprTyp(); class WyZakres{public:WyZakres(){}}; class WyTyp{public:WyTyp(){}}; }; //===================Metody szabkonow-Klasa podstawowa wzorca============================ template Wektor::Wektor(){ //sprTyp(); }; template void Wektor::back_push(T a){ sprTyp(); }; template void Wektor::erase(unsigned int ktora){ sprTyp(); }; template void Wektor::print(){ sprTyp(); }; template T Wektor::back_pop(){ sprTyp(); return wek[wek.size()-1]; }; template T& Wektor::operator[](unsigned int pozycja){ sprTyp(); return wek[pozycja]; }; template void Wektor::sprZakres(){ throw WyZakres(); }; template void Wektor::sprTyp(){ throw WyTyp(); }; //================================Metody klas specjalizowanych-int================================ template Wektor::Wektor(){ }; template void Wektor::back_push(int a){ if(wek.size() void Wektor::erase(unsigned int ktora){ if(ktora void Wektor::print(){ for(int i=0; i void Wektor::sort(int poczatek,int koniec){ //sortowanie za pomoca quicksorta int i, j, k, l, e; int x, tmp; e=(poczatek+koniec)/2; i=poczatek; j=koniec; x=wek[e]; do { while (wek[i]x) { l=j; j--; } if (i<=j) { k=i; l=j; tmp=wek[i]; wek[i]=wek[j]; wek[j]=tmp; i++; j--; } }while(i<=j); if (poczatek int Wektor::wielkosc(){ return (wek.size()-1); }; template void Wektor::back_pop(){ wek.pop_back(); }; template int& Wektor::operator[](unsigned int pozycja){ if(pozycja void Wektor::sprZakres(){ throw WyZakres(); }; template void Wektor::sprTyp(){ throw WyTyp(); }; //================================Metody klas specjalizowanych-double================================ template Wektor::Wektor(){ }; template void Wektor::back_push(double a){ if(wek.size() void Wektor::erase(unsigned int ktora){ if(ktora void Wektor::print(){ for(int i=0; i void Wektor::sort(int poczatek, int koniec){ //sortowanie za pomoca quicksorta int i, j, k, l, e; double x, tmp; e=(poczatek+koniec)/2; i=poczatek; j=koniec; x=wek[e]; do { while (wek[i]x) { l=j; j--; } if (i<=j) { k=i; l=j; tmp=wek[i]; wek[i]=wek[j]; wek[j]=tmp; i++; j--; } }while(i<=j); if (poczatek int Wektor::wielkosc(){ return (wek.size()-1); }; template void Wektor::back_pop(){ wek.pop_back(); }; template double& Wektor::operator[](unsigned int pozycja){ if(pozycja void Wektor::sprZakres(){ throw WyZakres(); }; template void Wektor::sprTyp(){ throw WyTyp(); }; //================================Metody klas specjalizowanych-LiczbaMax================================ template Wektor::Wektor(){ }; template void Wektor::back_push(LiczbaMax a){ if(wek.size() void Wektor::erase(unsigned int ktora){ if(ktora void Wektor::print(){ for(int i=0; i void Wektor::sort(){ }; template void Wektor::back_pop(){ wek.pop_back(); }; template LiczbaMax& Wektor::operator[](unsigned int pozycja){ if(pozycja void Wektor::sprZakres(){ throw WyZakres(); }; template void Wektor::sprTyp(){ throw WyTyp(); }; #endif