Let's say, i want to this thing:
std::thread(std::sin,2.9);
But i get unresolved function type error. How can i resolve it?
std::sin is overloaded, not template (why??)
Depending on what headers you included, there are the following:
template<class T> complex<T> sin (const complex<T>&); // <complex>
template<class T> valarray<T> sin (const valarray<T>&); // <valarray>
float sin(float); // <cmath>
long double sin(long double); // <cmath>
As you can see, there are templates involved, though that's actually not strictly relevant here.
You simply need to inform the compiler which [potential] overload you want (probably just out of the latter two):
std::thread((float(*)(float))&std::sin, 2.9);
static_cast.