S
S
serhiops2022-03-25 19:47:06
C++ / C#
serhiops, 2022-03-25 19:47:06

Why can't I use the thread library?

I'm trying to use the thread library, but it gives an error:
error: this_thread' has not been declared

Code:

#include <iostream>
#include<thread>
#include <chrono>
using namespace std;

int main()
{
    cout << this_thread::get_id()<<endl;
}

I went to the file with the library and almost all the code is inactive there (in vs code it is highlighted less brightly than the working code).

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question