pch07.h
来自「开放源码的编译器open watcom 1.6.0版的源代码」· C头文件 代码 · 共 26 行
H
26 行
#include "fail.h"
#include <process.h>
#include <iostream.h>
template <class T>
T* allocate(int size, T*) {
//set_new_handler(0);
T* tmp = (T*)(::operator new((unsigned int)(size * sizeof(T))));
if (tmp == 0) {
fail(__LINE__);
_PASS_EXIT;
}
return tmp;
}
struct S {
void x() {
allocate( 23, (S*) 0 );
}
};
int *x() {
return allocate( 23, (int*) 0 );
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?