goto文を恐れなく使う兵達のスレ
■ このスレッドは過去ログ倉庫に格納されています
0235デフォルトの名無しさん
NGNG// こんな感じのマクロ。
#define throws(T) T exception;
#define throw(x) exception=(x); goto catch_node
#define try if(1)
#define catch if(0) catch_node:
// 使用例。
void main( int argc, char** argv ) {
throws(int);
try {
if( 1 < argc ) {
if( atoi( argv[1] ) & 0x01 ) {
throw(e);
}
} catch {
printf("catch Exception![%d]\n",exception);
}
}
■ このスレッドは過去ログ倉庫に格納されています