// 失敗を例外では無くエラーコードで返す種類のライブラリなどを使うときに、
// 便利かもしれない。
// とかね。こんな感じで。
template< class T > class Pitcher {
public:
    T success,result;
    inline Pitcher( T v = 0 ) { result = success = v; }
    inline Pitcher<T>& operator<<=( T v ) {
        return check( v ), *this;
    }
    inline void check( T v ) {
        if( success != v ) throw( result = v );
    }
};

 // 使用例。
#include <stdio.h>
void main( int argc, char* argv[] ) {
    Pitcher<bool> result( true );
    try {
        result <<= argc > 1;
        printf("# %s\n", argv[1] );
    } catch( bool ) {
        printf("exception %d!\n", result.result );
    }
}