I have a problem relating to template functions and threads:
template
void Threader(TYPE_size counter)
{
counter++;
}
int main()
I'm taking the liberty of offering a variety of fixes to achieve what I believe is intended behaviour:
#include
template
void Threader(T & counter) // take by reference!
{
counter++;
}
int main()
{
unsigned int counter = 100;
std::thread one(Threader, // specify template *instance*
std::ref(counter) ); // pass variable as reference
one.join();
return counter;
}