随笔分类 -  C++

摘要:#include <iostream> #include <mutex> #include <thread> #include <condition_variable> std::mutex mutex; std::condition_variable cond; void in_msg() { w 阅读全文
posted @ 2022-08-07 22:12 thomas_blog 阅读(40) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <mutex> using namespace std; class MyInstance { MyInstance(){} public: static MyInstance *getInstance() { std::call_once( 阅读全文
posted @ 2022-08-07 15:46 thomas_blog 阅读(167) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; class MyInstance { MyInstance(){} public: static MyInstance *getInstance() { if(m_instance == NULL) { m_insta 阅读全文
posted @ 2022-08-07 15:11 thomas_blog 阅读(20) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <mutex> #include <thread> void msg_func() { std::mutex mutex; while(1) { std::unique_lock<std::mutex> unique(mutex); std: 阅读全文
posted @ 2022-08-07 13:26 thomas_blog 阅读(90) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <mutex> #include <thread> void msg_func() { std::mutex mutex; while(1) { std::unique_lock<std::mutex> unique(mutex, std:: 阅读全文
posted @ 2022-08-07 13:19 thomas_blog 阅读(85) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <mutex> #include <thread> void msg_func() { std::mutex mutex; while(1) { std::unique_lock<std::mutex> unique(mutex, std:: 阅读全文
posted @ 2022-08-07 13:08 thomas_blog 阅读(104) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <mutex> #include <thread> void msg_func() { std::mutex mutex; while(1) { mutex.lock(); std::unique_lock<std::mutex> uniqu 阅读全文
posted @ 2022-08-07 12:47 thomas_blog 阅读(122) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <mutex> #include <thread> void msg_func() { std::mutex mutex; while(1) { std::unique_lock<std::mutex> unique(mutex); std: 阅读全文
posted @ 2022-08-07 12:37 thomas_blog 阅读(39) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <mutex> #include <thread> void msg_func() { std::mutex mutex; while(1) { std::lock_guard<std::mutex> guard(mutex); std::c 阅读全文
posted @ 2022-08-07 12:08 thomas_blog 阅读(71) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 17:18 thomas_blog 阅读(212) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 17:01 thomas_blog 阅读(30) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:58 thomas_blog 阅读(85) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:46 thomas_blog 阅读(19) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <numeric> using namespace std; int main() { vector<int> v; for(int i = 0; i <= 100; i++) { v.push_back( 阅读全文
posted @ 2022-07-31 16:42 thomas_blog 阅读(26) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:30 thomas_blog 阅读(39) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:24 thomas_blog 阅读(38) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:16 thomas_blog 阅读(24) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:13 thomas_blog 阅读(22) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:08 thomas_blog 阅读(25) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:01 thomas_blog 阅读(34) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示