#include <boost/range/algorithm/for_each.hpp>
#include <iostream>
//#include <boost/array.hpp>
#include <boost/bind.hpp>
void disp2( int a, int b, int c ) {
if( b == 3 ) throw 1;
std::cout << a << ":" << b << ":" << c << ",";
}
int main() {
//boost::array<int,5> arr = {{ 1, 2, 3, 4, 5 }};
int arr[] = { 1, 2, 3, 4, 5 };
try {
boost::for_each( arr, boost::bind( disp2, 3, _1, 4) );
} catch( int err ) {
std::cout << "ERR: " << err << std::endl;
}
return 0;
}
レガシーAPI、ほとんど制覇できるかも・・・強烈だな・・・
0 件のコメント:
コメントを投稿