1#include <Windows.h>2#include <thread>3#include <iostream>4#include <tuple>5 using namespacestd;6 7 voidRun ()8 {9MessageBox (0, L"Hello", L"Hello",0);Ten } One A voidRunA (Constwchar_t *s,Constwchar_t *b) - { -MessageBox (0, S, B,0); the } - - classMyClass - { + Public: - void operator()()//C + + overloading + { AMessageBox (0, L"Hello", L"Hello",0); at } - }; - - voidmain1 () - { -Thread t1[3]{thread (run), Thread (run) , Thread (Run)}; in -Thread *P1 =Newthread (run); toThread *P2 =Newthread (run); + -Thread *p (Newthread[3]{thread (run), Thread (run) , Thread (Run)}); the //pseudo function *Thread t3[3]{Thread (MyClass ()), Thread (MyClass ()), Thread (MyClass ())}; $System"Pause");Panax Notoginseng } - the voidMain () + { A //Multithreading with Parameters theThread T1 (RunA, L"Wood man 1", L"HELLO"); +Thread T2 (RunA, L"Wood man 1", L"HELLO"); -thread t3 (RunA, L"Wood man 1", L"HELLO"); $ $ //tuple Array - CharCH ='X'; - ShortSH =129; the intnum =1234; - Char*p ="Wood man";Wuyituple<Char, Short,int,Char*>mytuple (CH, SH, num, p); theAuto I0 =Get<0>(mytuple); -cout << I0 <<Endl; WuAuto I1 =Get<1>(mytuple); -cout << I1 <<Endl; AboutAuto I2 =Get<2>(mytuple); $cout << i2 <<Endl; -Auto i3 =Get<3>(mytuple); -cout << i3 <<Endl; -Cin.Get(); A}
3. Multi-line Cheng, and tuple arrays