2
ফাংশন অবজেক্ট ব্যবহার করে সি ++ থ্রেড, একাধিক ডিস্ট্রাস্টারকে কীভাবে কনস্ট্রাক্টর বলা হয় না?
দয়া করে নীচে কোড স্নিপেট খুঁজুন: class tFunc{ int x; public: tFunc(){ cout<<"Constructed : "<<this<<endl; x = 1; } ~tFunc(){ cout<<"Destroyed : "<<this<<endl; } void operator()(){ x += 10; cout<<"Thread running at : "<<x<<endl; } int getX(){ return x; } }; int main() { tFunc t; thread t1(t); if(t1.joinable()) { …