reference wrapper.
#include <tr1/functional>
#include <iostream>
using namespace std;
void Increment( int& iValue )
{
iValue++;
}
int main(int argc, const char *argv[]) {
int iVariable = 0;
tr1::function< void()> fIncrementMyVariable = tr1::bind(&Increment,
tr1::ref( iVariable ));
fIncrementMyVariable();
cout << iVariable << endl;
return 0;
}
boost lambda
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/bind.hpp>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
using namespace boost::lambda;
int main(int argc, const char *argv[]) {
std::vector<int> v;
v.push_back(10);
v.push_back(20);
v.push_back(30);
for_each(v.begin(),
v.end(),
cout << _1 + 100 << "\n");
return 0;
}
numeric cast
#include <boost/numeric/conversion/cast.hpp>
#include <iostream>
using namespace std;
int main(int argc, const char *argv[]) {
cout << sizeof(int) << endl;
cout << sizeof(short) << endl;
int big = 65536 + 10;
short little = big;
cout << little << endl;
short good = boost::numeric_cast<short>(big);
return 0;
}
boost mpl
#include <boost/mpl/list.hpp>
#include <boost/mpl/push_front.hpp>
int main(int argc, const char *argv[]) {
typedef boost::mpl::list<float, double, long double> floats;
typedef boost::mpl::push_front<floats, int>::type types;
return 0;
}
分享到:
相关推荐
但一直没能实现,众里寻她千百度也没结果,现在应该差不多了,终于花了2、3天时间,给memo控件与listbox控件加上了背景图片,并自绘了他们的滚动条、光标、所选内容,同时,在memo中输入c++语言关键字,如int,char等...
C++ builder memo string finding sample. 完整代码+工程。备忘。
function SearchMemo(Memo: TCustomEdit; const SearchString: string; Options: TFindOptions): Boolean; var Buffer, P: PChar; Size: Word; begin Result := False; if Length(SearchString) = 0 then ...
C++Builder 资料库 提供50多个例子,带目录 1.怎样在C++Builder中创建使用DLL 2.用C++Bulider在WIN.INI中保存信息 3.如何在C++Builder中检测硬件 4.C++Builder如何响应消息及自定义消息 5.利用C++ ...
MEMO控件MEMO控件
完整高清,带目录版,c++自学著作(cplusplus in One Hour a Day)
Delphi 7.0 获取Memo控件中字符的可见行数,没讲 时在Memo控件中随便粘贴入一些字符,单击窗口中的“检测可见行数”按钮,即可得到该文本框控件中字符的行数,将这一系列执行命令集成在delphi的按钮监听事件中,编写...
- fixed bug when using two or more macroses in memo version 4.12 --------------- + added support of Embarcadero Rad Studio EX2 (x32/x64) + added export of Excel formulas in the BIFF export + added ...
动态改变FastReport内的Memo内容 Delphi 动态改变FastReport内的Memo内容 Delphi
谁能帮我看看怎么样过滤MEMO字段吗?试验的是ACCESS,实际是SQLITE
MyMemo
To form list of values in dropdown list of SubTitle filter automatically. To create grouping records basing on the selected coulmns. TDBVertGridEh component Component to show one record from ...
Delphi7中Memo组件实现查找替换功能
在memo中实现文字颜色设定,关键词高亮显示
Delphi,C++builder,Memo语法高亮
Privacy Friendly Memo Game Privacy Friendly Memo Game is a card game. The task is to find matching pairs within the cards. The application does not use any permission, which means it can provide its ...
Memo控件的使用方法和详解,比较全面的解释
利用Python编程 第二版 pdf 清晰版本,有目录,可以复制
动态改变FastReport内的Memo内容
To form list of values in dropdown list of SubTitle filter automatically. To create grouping records basing on the selected coulmns. TDBVertGridEh component Component to show one record from ...