Created
August 21, 2009 01:48
-
-
Save doitian/171594 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <boost/bind.hpp> | |
#include <boost/function.hpp> | |
#include <boost/thread.hpp> | |
template <typename T> | |
struct MFServer | |
{ | |
void run() | |
{ | |
std::cout << "run()" << std::endl; | |
} | |
}; | |
struct MFServer2 | |
{ | |
void run() | |
{ | |
std::cout << "run()" << std::endl; | |
} | |
}; | |
int main(int argc, char *argv[]) | |
{ | |
MFServer<int> mf; | |
MFServer2 mf2; | |
boost::thread t(boost::bind(&MFServer<int>::run, &mf)); | |
// boost::function0<void> f = boost::bind(&MFServer2::run, &mf2); | |
t.join(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment