How to enable experimental C++11 concurrency features in MinGW?

前端 未结 8 2008
夕颜
夕颜 2020-11-30 06:46

When trying to compile the following code

#include 
#include 

void foo() { std::cout << \"foo\\n\"; }

int main()
{
  st         


        
8条回答
  •  悲&欢浪女
    2020-11-30 07:08

    When you get a compiler that supports std::thread here is your corrected example (two minor type-o's):

    #include 
    #include 
    
    void foo() { std::cout << "foo\n"; }
    
    int main()
    {
      std::thread t(foo);
      t.join();
    }
    

提交回复
热议问题