C++ 模板

模板函数:

template <class T>

T func(T t1)

{

return t1;

}

模板类:

template <class T>

class CA

{

public:

T func(T t1);

}

template <class T>

T CA<T>::func(T t1)

{

return t1;

}

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>