对于STL的遍历操作,可以使用std:for_each,但是使用std:for_each的话,操作起来不是很灵活。1 // for_each. Apply a function to every element of a range.2 template 3 _Function for_each(....
分类:
其他好文 时间:
2015-04-11 16:06:41
阅读次数:
124
1.下载并解压至C盘boost路径下,如C:\boost;2.执行bootstrap.bat生成bjam.exe;3.编译命令如下:整个编译用时约2小时,运行完后(弹出输入提示符) bjam stage--without-python--toolset=msvc-10.0 address-mode....
场景:使用boost库的正则模块时出现编译超慢的情况,看了头文件#include 的引用关系,它依赖的头文件相当多,这应该就是根本原因吧。目前知道可行的方案只有使用预编译头。vs放到stdafx.h后,就编译一次,然后其他需要的地方,会去一个本地的pch文件里.一些。”“VC创建项目时自动创建的预编...
分类:
其他好文 时间:
2015-04-08 16:17:22
阅读次数:
158
简介STL的 __pool_alloc, __mt_alloc,boost的pool系列, ace的ACE_Cached_Allocator均为定长内存池。说明内存池,根据存储的元素的长度是否可变,分为变长,与定长两种内存池。从逻辑上来讲,定长内存池只需存储相同大小的元素,因此无须花费额外的空间(数...
分类:
其他好文 时间:
2015-04-07 22:55:28
阅读次数:
225
在源码安装mysql5.7系列时,出现如下错误:错误现象:CMakeErroratcmake/boost.cmake:76(MESSAGE):Youcandownloaditwith-DDOWNLOAD_BOOST=1-DWITH_BOOST=<directory>ThisCMakescriptwilllookforboostin<directory>.Ifitisnotthere,itwilldownloadandunpackit(intha..
分类:
其他好文 时间:
2015-04-07 20:16:54
阅读次数:
129
在源码安装mysql5.7系列时,出现如下错误:错误现象:CMakeErroratcmake/boost.cmake:76(MESSAGE):Youcandownloaditwith-DDOWNLOAD_BOOST=1-DWITH_BOOST=<directory>ThisCMakescriptwilllookforboostin<directory>.Ifitisnotthere,itwilldownloadandunpackit(intha..
分类:
其他好文 时间:
2015-04-07 20:15:14
阅读次数:
178
在源码安装mysql5.7系列时,出现如下错误:错误现象:CMakeErroratcmake/boost.cmake:76(MESSAGE):Youcandownloaditwith-DDOWNLOAD_BOOST=1-DWITH_BOOST=<directory>ThisCMakescriptwilllookforboostin<directory>.Ifitisnotthere,itwilldownloadandunpackit(intha..
分类:
其他好文 时间:
2015-04-07 20:07:59
阅读次数:
122
2 用于判断类型的traits类is_void类可以判断模板参数的类型,使用很简单,注意,也可以直接使用::value。cout ::type::value << endl;
cout ::type::value << endl;
但是实现很有趣,特化居然可以用来继承不同的类。这里没有去找clang++实现代码,用boost代码代替吧。template
struct is_void : publ...
分类:
编程语言 时间:
2015-04-06 23:21:06
阅读次数:
293
1 integral_constant类这个类是所有traits类的基类,分别提供了以下功能:value_type 表示值的类型value表示值type 表示自己, 因此可以用::type::value来获取值true_type和false_type两个特化类用来表示bool值类型的traits,很多traits类都需要继承它们下面的代码分别来自C++11和Boost,略有差别:C++11包含va...
分类:
编程语言 时间:
2015-04-06 18:45:19
阅读次数:
298
(1)error: LNK1104: cannot open file 'libboost_thread-vc120-mt-gd-1_57.lib编译boost库程序时出现问题解决方法如下:1.首先运行D:\boost_1_54_0目录下的bootstrap.bat文件。此时在该目录下生成文件b2....
分类:
其他好文 时间:
2015-04-04 22:29:30
阅读次数:
129