Enforce
これ使えそうだなぁ。
Enforcements | Dr Dobb's
PowerPlant*1の ThrowIf_ マクロを思い出す。
int no = ... Widget* pWidget = MakeWidget(no); ENFORCE(pWidget)("Widget #")(no)("This widget is null and it shouldn't!");
やるなぁ
*1:いまは亡き CodeWarrior for Mac の C++ Framework