Witam. Mam pewien problem otóż stworzyłem wewnątrz szablonu klasy szablon funkcji . I teraz chciałbym zrobić jawna specjalizacje tej funkcji. Jak to zrobić . Kombinuje jak mogę ale ciągle coś jest źle.
Wklejam kod z pliku .h (tu jest caly kod)
#ifndef SZABLONIK_
#define SZABLONIK_
#include <iostream>
#include <exception>
using namespace std;
template <typename T1>
class Szablonik
{
private:
int a;
T1 b;
class Bad_error : public exception
{
private:
int ile;
public:
Bad_error(){};
Bad_error(int aw):ile(aw){};
void What(){cout<<"cos nie tak";}
};
public:
Szablonik(): a(0),b(0) {};
Szablonik(int we, T1 be): a(we),b(be) {};
Szablonik & operator+(Szablonik & aw);
template <typename U1>
friend ostream & operator<<(ostream & os,const Szablonik<U1>& );
void cos(int ww){ a+=ww;}
template <typename C1>
void kupczyk (C1& i){cout<<i.a;}
template <> void kupczyk <double>(double & aw){cout<<aw;}
};
template <typename T1>
Szablonik<T1> & Szablonik<T1>::operator+(Szablonik<T1> & aw)
{
this->a += aw.a;
return *this;
}
template <typename U1>
ostream & operator <<(ostream & os,const Szablonik<U1> & t)
{
os<<t.a<<", "<<t.b<<endl;
return os;
}
#endif // SZABLONIK_
Z góry dzięki za pomoc