I have a problem relating to template functions and threads:
template
void Threader(TYPE_size counter)
{
counter++;
}
int main()
There is no function named Threader. When you write Threader
or something, then the compiler creates a function. If you then write Threader
, then the compiler creates a new function. You can either provide a default template parameter, or give it a parameter when you call it.
template
or
thread one(Threader, counter);