C/C++

template . , , . , .

.

tetemplate > _ _ (_)
{
	// 
}

- , . template - , , .

.

template  void swap (X &a, X &b)
{
	X temp;
	temp = a;
	a = b;
	b = temp;
}
//
int a, b;
float x, y;
swap (a, b);
swap (x, y);

, , , class. .

.

template _> class _ {
//...
};

_ - , . , .

_<_> ;

.

template 
class My{
	T x;
public:
	void Set();
};

template 
int My :: Set(T mx)
{
	T = mx;
}

My c;	// 
c.Set(12);

export

export template. , ( ).

typename

C++ typename, class template .






Нет комментариев.



Оставить комментарий:
Ваше Имя:
Email:
Антибот: *  
Ваш комментарий: