码迷,mamicode.com
首页 >  
搜索关键字:boost 源代码行统计    ( 1957个结果
非常方便的circular_buffer
编程时候经常需要使用定长的容器(fixed size container),比如有时日志只需要保留一周或一个月,或者缓存一天上游发来的数据流。实现一个简单的旋转容器只需要像下面这样就好:std::vector vec(size);vec[i % size] = newelem;boost的circu...
分类:其他好文   时间:2015-01-29 14:20:20    阅读次数:150
boost智能指针之shared_ptr和weak_ptr
std::auto_ptr很多的时候并不能满足我们的要求,比如auto_ptr不能用作STL容器的元素。boost的smart_ptr中提供了4种智能指针和2种智能指针数组来作为std::auto_ptr的补充。   shared_ptr:使用shared_ptr进行对象的生存期自动管理,使得分享资源所有权变得有效且安全. weak_ptr:weak_ptr 是 shared_ptr 的观察员...
分类:其他好文   时间:2015-01-29 09:22:31    阅读次数:288
Linux编译安装boost-1_57
1 unzip boost_1_57_0.zip2 ./bootstrap.sh3 ./b2 toolset=gcc cxxflags="-std=c++11" install4 find / -name libboost*.a/usr/local/lib目录下头文件在/usr/local/incl...
分类:系统相关   时间:2015-01-28 17:42:40    阅读次数:1325
开源免费的C/C++网络库(c/c++ sockets library)
(1)ACE庞大、复杂,适合大型项目。开源、免费,不依赖第三方库,支持跨平台。http://www.cs.wustl.edu/~schmidt/ACE.html(2)AsioAsio基于Boost开发的异步IO库,封装了Socket,简化基于socket程序的开发。开源、免费,支持跨平台。http:...
分类:编程语言   时间:2015-01-28 17:31:28    阅读次数:189
Boost::regex练习实例
#include #include #include #include #include #include using namespace std; using namespace boost; //写一个程序,提取之间的内容 ...
分类:其他好文   时间:2015-01-28 17:24:44    阅读次数:200
Boost::Regex代码示例
看一个别人给出的例子,当我们输入“select 字符串 from 字符串”的时候,会得到输出;如果不符合这个格式,就会输出error。注意:在命令行下输入的时候,按ctrl+Z、回车表示行输入结束。 #include #include #include #include...
分类:其他好文   时间:2015-01-28 17:17:42    阅读次数:187
linux下mutex与atomic性能比较
一种是用boost::atomic;一种直接加锁;代码很简单: #include #include #include #include #include #include #include #include static int loop_num = 10000; boost::atomic a(0); static boost::mutex mtx_; static v...
分类:系统相关   时间:2015-01-28 01:01:01    阅读次数:352
boost.asio包装类st_asio_wrapper开发教程(2013.12.8更新)(二)
如果你是偶然浏览到这里,请先看源代码及例程下载地址:命令行:svn checkout http://st-asio-wrapper.googlecode.com/svn/trunk/ st-asio-wrapper-read-only如果从svn客户端界面上打开,则只输入http://st-asio...
分类:移动开发   时间:2015-01-28 00:56:32    阅读次数:327
boost.asio包装类st_asio_wrapper开发教程(一)
一:什么是st_asio_wrapper它是一个c/s网络编程框架,基于对boost.asio的包装(最低在boost-1.49.0上调试过),目的是快速的构建一个c/s系统;二:st_asio_wrapper的特点效率高、跨平台、完全异步,当然这是从boost.asio继承而来;自动重连,数据透明...
分类:移动开发   时间:2015-01-28 00:51:34    阅读次数:328
boost::any( 能存放任何类型的数据)原理
===================== template class any { public:     T m_data; }; void main() {     any a;     } 缺点是 必须知道类型,有时我们并不知道某个对象的类型。 ------------- class any { public:     template     any...
分类:其他好文   时间:2015-01-27 18:21:59    阅读次数:177
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!