2016-06-20 5 views
1

は、私は、FNがあればというロジックを実装するこの抽出引数::機能

int foo(int x) { 
    cout<<"Argument passed x = "<<x; 
    return x; 
} 
int main() { 
    boost::function<void()> fn = boost::bind(foo, 10); 
    // can I get 10 out of fn object 
    // if (fn._1 == 10) { 
    // return; 
    //} 
    fn(); 
} 

のようなコードを持っています。出来ますか?

答えて

2

boost visit_each施設チケットかもしれない - しかし、それは実験および文書化されていないあるとして、私はより詳細な情報を持っていない...

ああ、私は知っています、待って:それはあなたのように何をしたい、実際にありますtheir example,compiled and executed on ideone.com