cltemp21.c
来自「开放源码的编译器open watcom 1.6.0版的源代码」· C语言 代码 · 共 29 行
C
29 行
#include "fail.h"
// updated template class explicit instatiation syntax
// definitions in cltmp21b.c
template< class T >
class X{
public:
void fn( T x );
T v;
};
template< class T >
class Y{
public:
T fnb( T x );
};
// more explicit template type stuff can go here once it is implemented...
// template function
// template member function
int main() {
X< long > x;
Y< double > y;
x.fn( 3 );
if( y.fnb( 0.5 + x.v ) != 30.25 ) fail( __LINE__ );
_PASS;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?