Skip to content

Instantly share code, notes, and snippets.

@doitian
Created August 21, 2009 01:48
Show Gist options
  • Save doitian/171594 to your computer and use it in GitHub Desktop.
Save doitian/171594 to your computer and use it in GitHub Desktop.
#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