so what

2008-12-18

boost::bind萌え〜

C++

思わず顔がにやけてしまった。

#include <iostream>
#include <string>

#include <boost/bind.hpp>
#include <boost/function.hpp>

using namespace std;

int add(int a, int b) {
  return a + b;
}

int main() {
  boost::function<int (int)> f = boost::bind(add, 5, _1);
  cout << f(1) << endl;
  cout << f(2) << endl;
	return 0;
}


6
7

winebarrel 2008-12-18 00:00

boost::bind萌え〜
この記事をはてなブックマークに追加
Tweet
  • もっと読む
コメントを書く
« boost::asio: echoサーバ boost:クロージャを作る »
プロフィール
id:winebarrel id:winebarrel はてなブログPro
検索
リンク
  • Twitter
  • Bitbucket
  • GitHub
最新記事
  • Aurora/RDS用プロダクション→ステージング レプリケーションツールを書いた
  • SpringOnion: Railsの遅そうなEXPLAINをログ出力するgem
  • CSVとかTSVをJSON LinesにするツールをGoとRustで書いた
  • qrnというDBベンチマークツールを作った
  • SendGridのv3 Mail Send APIのRuby Clientを書いた
月別アーカイブ

はてなブログをはじめよう!

winebarrelさんは、はてなブログを使っています。あなたもはてなブログをはじめてみませんか?

はてなブログをはじめる(無料)
はてなブログとは
so what so what

Powered by Hatena Blog | ブログを報告する

スターをつけました

引用をストックしました

引用するにはまずログインしてください

引用をストックできませんでした。再度お試しください

限定公開記事のため引用できません。

読者です 読者をやめる 読者になる 読者になる