I know they do not work for this version of mingw, which is why I use the version on this link . But I do not compile this example because it says
In static member function 'static unsigned int mingw_stdthread :: thread :: _ hardware_concurrency_helper ()':
error: ':: GetNativeSystemInfo' has not been declared (in line 266)
This in the thread file I downloaded, I tested on this site and this example worked , could anyone tell me why this happened? / p>
#include <iostream> // std::cout
#include <thread> // std::thread
class test {
public:
static void foo(){}
static void bar(int x){}
test(){
std::thread first (foo); // spawn new thread that calls foo()
std::thread second (bar,0); // spawn new thread that calls bar(0)
first.join(); // pauses until first finishes
second.join(); // pauses until second finishes
}
};
int main() {
test TESTE;
return 0;
}