らんだむな記憶

blogというものを体験してみようか!的なー

例外処理

void youareshock() try
{
    throw;

    puts("お前は既に死んでいる!");
}
catch (...) {
    puts("あべし");
}

すると、

terminate called without an active exception
中止 (コアダンプ)

してしまう。catchステートメントの中でもないのに例外再送出すんなやというのはさておき。

実際どうなのかなぁとBjarne Stroustrupの本(但し結構古い版だが)を見てみる。
「14.3.1 Re-Throw」

A re-throw is indicated by a throw without an oprand. If a re-throw is attempted when there is no exception to re-throw, terminate() will be called.

ふむ...。

メソッドの外側(?)でtry & catchするのもなんかキモぃが、14.4.6.1~14.6にかけてこの形での解説が出てくる。

しかし... Amazon.com: The C++ Programming Language, 4th Edition (0000321563840): Stroustrup, Bjarne: Books 4th Editionともなると、1400ページ近いのはなんとかならんのか...。3rd Editionの初期の頃ならぎりぎり1000ページ未満だったのだが...。

そしていい勝負で分厚いやつがこれだ→ Learning Python, 5th Edition: Lutz, Mark: 9781449355739: Amazon.com: Books 1600ページだが一体何を "learning" 系でそこまで語る必要があるのだろう。Programming Python: Powerful Object-Oriented Programming: Lutz, Mark: 8601400192511: Amazon.com: Booksも厳しい。
正直The Ruby Programming Language: Everything You Need to Know: Flanagan, David, Matsumoto, Yukihiro: 9780596516178: Amazon.com: Booksくらいでお願いしたいものだ。
Programming Perl: Unmatched power for text processing and scripting: Christiansen, Tom, foy, brian d, Wall, Larry, Orwant, Jon: 9780596004927: Amazon.com: Booksおっと... Perlも案外厳しい。

洋書は分厚いのが多いなぁ。とりあえず、海外で人気のpythonサンの「Programming XXX」本が分厚すぎて買う気になれない。http://www.amazon.co.jp/Python%E3%83%81%E3%83%A5%E3%83%BC%E3%83%88%E3%83%AA%E3%82%A2%E3%83%AB-%E7%AC%AC2%E7%89%88-Guido-van-Rossum/dp/487311442X/で軽く肩慣らしをして、後は一気にエキスパートPythonプログラミング | Tarek Ziade, 稲田直哉, 渋川よしき, 清水川貴之, 森本哲也 |本 | 通販 | Amazonとかに飛んでしまえばいいかも。expertの和訳はpython3まで補足してあるし、原書よりも安いので結構お得か?

なんとなく、「Programming XXX」で500ページくらいでまとめて、「More Programming XXX」でがつーんと深層までいくぞーみたいにしてくれるといいのにな、と思わなくもない。