不定期更新,只是提醒我可以用qq
1.一般的boost庫
bjam --toolset=msvc-9.0 --build-type=complete stage
bjam --toolset=msvc-9.0 --build-type=complete install
2.有ICU支援的boost庫
先去http://site.icu-project.org/載一回來編譯
bjam -sICU_PATH=C:\clibrary\icu --toolset=msvc-9.0 --build-type=complete stage
bjam -sICU_PATH=C:\clibrary\icu --toolset=msvc-9.0 --build-type=complete install
如果是用vc的話內建的wchar_t就可以比對了,不需要用加icu版的regex
<boost/foreach.hpp>
std::list<int> list_int( /*...*/ );
BOOST_FOREACH( int i, list_int )
{
// do something with i
}
#include "boost/lexical_cast.hpp"
lexical_cast 字串流與數字間 >>, <<的轉換
"boost/cast.hpp"
numeric_cast 怕數字爆炸的轉換
"boost/utility.hpp"
noncopyable
"boost/operators.hpp"
totally_ordered 等於下面兩個
less_than_comparable 需要 bool operator<(const T&, const T&);
equality_comparable 需要 bool operator==(const T&,const T&);
additive 加法減法
addable 需要 T operator+=(const T&);
subtractable 需要 T operator-=(const T&,const T&);
Regex 或 xpressive
"boost/bind.hpp"
bind
#include "boost/bind.hpp"
void nine_arguments(
int i1,int i2,int i3,int i4,
int i5,int i6,int i7,int i8, int i9) {
std::cout << i1 << i2 << i3 << i4 << i5
<< i6 << i7 << i8 << i9 << '\n';
}
int main() {
int i1=1,i2=2,i3=3,i4=4,i5=5,i6=6,i7=7,i8=8,i9=9;
(boost::bind(&nine_arguments,_9,_2,_1,_6,_3,_8,_4,_5,_7))
(i1,i2,i3,i4,i5,i6,i7,i8,i9);
}
Lambda
"boost/lambda/lambda.hpp"
"boost/lambda/bind.hpp"
"boost/lambda/loops.hpp"
"boost/lambda/switch.hpp"
"boost/lambda/construct.hpp"
"boost/lambda/casts.hpp"
"boost/lambda/algorithm.hpp"
"boost/lambda/numeric.hpp"
Function 好定義好看的函數指標
"boost/function.hpp"
boost::function<void (int,double)> f;
"boost/signals.hpp"
Signals 好看的callback