#include <iostream>
#include <thread>

class f
{
public:
    f(int i = 0, std::string s = "") : _i(i), _s(s) { }
    void operator()() const
    {
       for(int i = 0; i < _i; ++i)
          std::cout << _s << std::endl;
    }
    int _i;
    std::string _s;
};


int main()
{
	//std::thread t1(f());            // Most vexing parse (Scott Meyers: Effective STL)
	std::thread t2((f(3, "Hello")));  // OK
	//t1.join();  // prog.cpp:23:5: error: request for member 'join' in 't1', 
	              // which is of non-class type 'std::thread(f (*)())'
	t2.join();
	return 0;
}