0
RAII for thread
Hi I just tried to use inherit thread to ensure that if someone forget to join thread object, destructor should detach it. Refer below code and it would be helpful if you can suggest why it is not compiling https://code.sololearn.com/ca04A25a247A
2 Réponses
+ 1
You have to explicitly inherit the base constructors if you don't want to create your own.
Add
using thread::thread;
in the public part of the class mythread
0
Thank you.
Yes, it is working if I add thread constructor.... But refer below code:
https://code.sololearn.com/c8a8a23a23a2/#cpp
Here, without adding constructor into mylist, it works. Is it like we need to add constructor also if destructor is defined by us?