function-まとめ
とりあえず最低限の機能だけです。
- function1 - while( c++ );
- function2 - while( c++ );
- function3-mem_fun - while( c++ );
- function4-mem_fun - while( c++ );
- function5-bind - while( c++ );
- function6-bind - while( c++ );
- function7-placeholder - while( c++ );
- function8-function+bind - while( c++ );
- function9-perlを使ってみる - while( c++ );
int main() { { //自作boost風function xtl::function< int ( int, float ) > f; //グローバル関数 f = hoge; f( 0, 1.0f ); //関数オブジェクト f = piyo(); f( 0, 1.0f ); //メンバ関数 f = xtl::bind( &fuga::func, new fuga, xtl::_1, xtl::_2 ); f( 0, 1.0f ); } { boost::function< int ( int, float ) > f; //グローバル関数 f = hoge; f( 0, 1.0f ); //関数オブジェクト f = piyo(); f( 0, 1.0f ); //メンバ関数 f = boost::bind( &fuga::func, new fuga, _1, _2 ); f( 0, 1.0f ); } return 0; }