All pastes #920900 Raw Edit

Anonymous

public text v1 · immutable
#920900 ·published 2008-02-27 18:13 UTC
rendered paste body
#include <iostream>
#include <windows.h>

#define foreach BOOST_FOREACH

class Thread
{
public:
	Thread()
	{
		CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Thread::static_run, this, 0, &id_);
	}
protected:
	int run()
	{
		std::cout << "test";
		return 0;
	}
private:
	static DWORD WINAPI static_run(LPVOID *data)
	{
		Thread *thr = reinterpret_cast<Thread *>(data);
		return (*thr).run();
	}
	DWORD id_;
};


int main(int argc, char *argv[])
{
	Thread x;
	while(1){}
}