Значит, необходимо ставить Windows
#include "boost/variant.hpp"
boost::variant<int, std::string > f(int i)
{
if (i == 0)
{
return 1;
}
else
{
return std::string("str");
}
}
int main()
{
std::cout << f(0) << " " << f(1) << std::endl;
}
class UserThreadNotify
{
public:
virtual void OnSomeNotification(/*args*/);
};
class UserThread
{
public:
UserThread(UserThreadNotify *notify) :notify(_notify) {}
private:
void OnSomeEvent() { notify->OnSomeNotification(/*args*/); }
UserThreadNotify *notify;
};
class GeneralThread : public UserThreadNotify
{
public:
virtual void OnSomeNotification(/*args*/) {/*...*/}
private:
void CreateUserThread() {/*...*/ UserThread(this);}
};