mirror of
https://github.com/Relintai/programming_tutorials.git
synced 2025-04-25 21:55:03 +02:00
23 lines
329 B
C++
23 lines
329 B
C++
#ifndef THREAD_CLASS_H
|
|
#define THREAD_CLASS_H
|
|
|
|
#include <iostream>
|
|
#include <thread>
|
|
|
|
using namespace std;
|
|
|
|
class ThreadClass {
|
|
|
|
static void print_hello() {
|
|
cout << "Hello, thread form a class!" << endl;
|
|
}
|
|
|
|
public:
|
|
void hello() {
|
|
thread t(ThreadClass::print_hello);
|
|
t.join();
|
|
}
|
|
};
|
|
|
|
#endif
|