![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
编程
文章平均质量分 64
qidongzhou
这个作者很懒,什么都没留下…
展开
-
循环加快——C++
#ifndef LOCALVARIABLES_H_ #define LOCALVARIABLES_H_ #include #include const int N = 10000000; class A { public: int getValue() { return a; } private: int a; }; class TestTime {原创 2014-06-26 10:13:58 · 906 阅读 · 0 评论 -
thread create method(1)
#include #include #include boost::mutex io_mutex; struct count { count(int id) : id(id) { } void operator()() { for (int i = 0; i { boost:原创 2014-06-27 10:58:43 · 271 阅读 · 0 评论 -
boost::thread(wait/join/interrupt/detach)
#include #include #include #include #include void wait(int seconds) { boost::this_thread::sleep(boost::posix_time::seconds(seconds)); } void threadfun1() { for (int i = 0; i转载 2014-06-27 14:49:39 · 1037 阅读 · 0 评论 -
boost::thread (barrier)
#include #include #include #include #include #include // for time() #include // for Sleep, change it for other platform, we can use // boost::thread::sleep, but it's too inconvenient.转载 2014-06-27 17:22:51 · 389 阅读 · 0 评论 -
boost::thread(Product,consumer)(1)
#include #include #include #include #include #include // for time() #include // for Sleep, change it for other platform, we can use // boost::thread::sleep, but it's too inconvenient.转载 2014-06-27 16:30:26 · 278 阅读 · 0 评论 -
boost:thread2
output 00448138 收到notify! 00448138 收到notify! 00448138 收到notify! 00448138 收到notify! 00448138 收到notify! 00448138 收到notify! 00448138 收到notify! 00448138 收到notify! 00448138 收到notify! 00448138 收到n原创 2014-06-27 11:20:27 · 400 阅读 · 0 评论 -
boost::function的简单用法
#include #include "boost/function.hpp" #include "boost/bind.hpp" using namespace std; class Foo { public: void methodA() { cout } void methodInt(int a) {转载 2014-06-26 17:04:34 · 296 阅读 · 0 评论 -
shared_ptr
// mem.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include //#include "../../../../../linux/mcsf/uih/include/external/boost/shared_ptr.hpp" #include "boost原创 2014-06-26 09:52:55 · 279 阅读 · 0 评论 -
内联函数(类中)
成员函数是属于对象的, 静态函数才是属于类的. 如果在类体内定义的函数,则会被编译器默认为内联函数, 如果把函数的定义放在外面,且在函数的声明的时候加上关键字inline,则函数变为内联函数,否则为成员函数.原创 2014-06-26 15:06:50 · 324 阅读 · 0 评论 -
boost::thread(3)
#include #include #include #include #include void wait(int seconds) { boost::this_thread::sleep(boost::posix_time::seconds(seconds)); } boost::mutex mutex; boost::condition_variable转载 2014-06-27 14:10:07 · 331 阅读 · 0 评论