Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00014 #include <boost/bind.hpp>
00015 #include <boost/function.hpp>
00016 #include <iostream>
00017
00018 using namespace std;
00019
00020 void f() {
00021 cout << "f executed" << endl;
00022 }
00023 int main() {
00024 boost::function<void()> fn;
00025
00026 cout << "not yet created" << endl;
00027 if (!fn.empty())
00028 fn();
00029
00030 fn = boost::bind(f);
00031
00032 cout << "should be called" << endl;
00033 if (!fn.empty())
00034 fn();
00035
00036 fn = NULL;
00037
00038 cout << "reinitialized" << endl;
00039 if (!fn.empty())
00040 fn();
00041 return 0;
00042 }