Wiki内検索
最近更新したページ
2011-08-24
2010-05-18
2010-05-03
2010-02-18
2010-02-10
2010-02-09
2010-02-08
2010-02-07
2010-02-02
2009-12-24
2009-12-05
2009-07-05
2009-07-03
最新コメント
MenuBar1 by stunning seo guys
MenuBar1 by stunning seo guys
MenuBar1 by stunning seo guys
MenuBar1 by awesome things!
MenuBar1 by awesome things!
MenuBar1 by awesome things!
MenuBar1 by check it out
MenuBar1 by awesome things!
MenuBar1 by check it out
MenuBar1 by stunning seo guys
Menu
Programming Tips
タグ

boost_prepocessor1

boost preprocessorの使い方1

forループ

#include <iostream>
#include <boost/preprocessor.hpp>
using namespace std;
void print(int num)
{
cout << num << endl;
};
#define PRED(r,i) BOOST_PP_LESS(i,6)
#define INC(r,i) BOOST_PP_INC(i)
#define GEN(r,i) print(BOOST_PP_CAT(num,i));

int main()
{
int num1 = 100;
int num2 = 200;
int num3 = 300;
int num4 = 400;
int num5 = 500;
BOOST_PP_FOR(1,PRED,INC ,GEN);
};
2008年07月14日(月) 19:12:20 Modified by eruvasu




スマートフォン版で見る